forked from mtp401/dot-vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
122 lines (103 loc) · 2.99 KB
/
init.lua
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
-- security
vim.o.exrc = false -- ignore ~/.exrc
vim.o.secure = true -- disallow local rc exec
-- tab / whitespace control
vim.o.expandtab = true -- expand hard tabs to spaces
vim.o.softtabstop=4 -- expand tabs to 4 spaces
vim.o.tabstop = 8 -- use 8 spaces for hard tabs
-- formatting options
vim.o.autoindent = true
vim.o.shiftwidth = 4
vim.o.shiftround = true
vim.o.textwidth = 79
vim.opt.formatoptions = vim.opt.formatoptions
+ 't'
+ 'c'
+ 'r'
- 'o'
+ 'q'
- 'a'
+ 'n'
- '2'
+ 'j'
-- display settings
vim.o.number = true
vim.o.ruler = true
vim.o.hidden = true
vim.o.hlsearch = true
vim.opt.listchars = {
trail = '-',
nbsp = '+',
eol = '$',
tab = '>-'
}
vim.opt.termguicolors = true
vim.opt.syntax = 'on'
vim.opt.laststatus = 2
-- windows
vim.o.splitbelow = true
vim.o.splitright = true
-- editing
vim.o.mouse = ''
vim.o.showmatch = true
vim.o.clipboard = 'unnamed,unnamedplus'
vim.o.undofile = true
vim.o.undodir = vim.env.HOME .. '/.vim/undodir'
vim.o.backspace = 'indent,eol,start'
vim.api.nvim_set_keymap('n', 'O', 'O<esc>', {noremap = true})
vim.api.nvim_set_keymap('n', 'o', 'o<esc>', {noremap = true})
vim.g.loaded_ruby_provider = 0
vim.g.loaded_python_provider = 0
vim.g.loaded_python3_provider = 0
vim.g.loaded_perl_provider = 0
vim.g.loaded_node_provider = 0
-- plugins
vim.cmd('packadd paq-nvim')
local paq = require('paq').paq
paq({'savq/paq-nvim', opt = true})
paq({'nvim-treesitter/nvim-treesitter'})
require('nvim-treesitter.configs').setup({
highlight = {enable = true},
incremental_selection = {enable = true},
indent = {enable = true}
})
paq({'norcalli/nvim-colorizer.lua'})
require('colorizer').setup()
paq({'marko-cerovac/material.nvim'})
vim.g.material_custom_colors = require('custom-material-colors').colors
require('material').set()
paq({'kyazdani42/nvim-web-devicons', opt = true})
paq({'hoob3rt/lualine.nvim'})
require('lualine').setup({
options = {theme = 'material'}
})
paq({'neovim/nvim-lspconfig'})
local lspconfig = require('lspconfig')
lspconfig.clangd.setup({})
lspconfig.rust_analyzer.setup({})
vim.g.ale_linters_explicit = 1
vim.g.ale_linters = {
cpp = {'cpplint'}, -- `pip install --user cpplint`
gitcommit = {'gitlint'}, -- `pip install --user gitlint`
markdown = {'mdl'}, -- `gem install mdl`
sh = {'shellcheck'}, -- `cabal update; cabal install ShellCheck`
yaml = {'yamllint'} -- `pip install --user yamllint`
}
paq({'w0rp/ale'})
paq({'tpope/vim-fugitive'})
paq({'godlygeek/tabular'})
paq({'martinda/Jenkinsfile-vim-syntax'})
vim.g.vim_markdown_folding_disabled = 1
paq({'plasticboy/vim-markdown'})
paq({'nvim-lua/popup.nvim'})
paq({'nvim-lua/plenary.nvim'})
paq({'nvim-telescope/telescope.nvim'})
-- miscellaneous
vim.g.vimpager_scrolloff = 0
-- use real tabs in Makefiles and Kconfig
vim.api.nvim_command([[
augroup ExpandTabsOverride
autocmd! FileType make setlocal noexpandtab sw=4 ts=4 sts=4
autocmd! FileType kconfig setlocal noexpandtab sw=4 ts=4 sts=4
augroup END
]])