summaryrefslogtreecommitdiff
path: root/init.lua
blob: 632a76c0c3e4beff8a37dade5161ba4796bef920 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
-- Change color scheme
-- set background=dark
-- if has("gui_running")
--     set guioptions-=m  " remove menu bar
--     set guioptions-=T  " remove toolbar
--     set guioptions-=r  " remove right-hand scroll bar
--     set guioptions-=L  " remove left-hand scroll bar
--     set guioptions-=e  " vim looking tabs
--     set antialias
--     " set macligatures
--     set guiligatures=!\"#$%&()*+-./:<=>?@[]^_{\|~
--     set guioptions+=k
--     let &guifont="Fira Code:h17"
--     colorscheme ayu
-- else
--     colorscheme molokai
-- endif
vim.opt.termguicolors = true
vim.cmd.colorscheme("molokai")

-- Tab configuration
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.backspace = {"indent", "eol", "start"}

-- Show whitespace characters
vim.opt.listchars = {
  tab = "├─┤",
  trail = "␠",
  nbsp = "⎵",
  lead = "·"
}
vim.opt.list = true

-- Set line numbering rules
vim.wo.number = true
vim.wo.relativenumber = true
vim.api.nvim_create_autocmd("InsertEnter", {
  pattern = "*",
  callback = function (ev)
    vim.wo.number = true
    vim.wo.relativenumber = false
  end
})
vim.api.nvim_create_autocmd("InsertLeave", {
  pattern = "*",
  callback = function (ev)
    vim.wo.number = true
    vim.wo.relativenumber = true
  end
})

-- Automatically change current directory to be the same as the file editing
vim.opt.autochdir = true

-- Remove conceal for all files
vim.opt.conceallevel = 0

-- Paragraph formatter
-- let &formatprg="par -w80"

-- Encodings
vim.opt.fileencodings = {"utf8", "cp1251", "koi8-r", "latin1"}

-- " Spelling
-- set spell spelllang=ru,en

-- Add vertical rulers
vim.opt.colorcolumn = {81, 121}

-- netrw
vim.g.netrw_banner = false
vim.g.netrw_liststyle = 1

require("keybindings")
require("filetype-config")
require("plugins")