-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.lua
114 lines (101 loc) · 3.17 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
vim.opt.number = true
vim.opt.scrolloff = 4
vim.opt.expandtab = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.shiftround = true
vim.opt.list = true
vim.opt.listchars = {tab = "| ", trail="·"}
vim.opt.guicursor = ""
vim.opt.mouse = "a"
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.statusline = "%F%( %m%) %( %r%)%( %h%)%=%{&ft}"
vim.opt.fillchars = {stl = " ", stlnc = " ", vert = " ", diff = " ", fold = " "}
vim.opt.wildignore = {
"*.dll",
"*.o",
"*.pyc",
"*.bak",
"*.exe",
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
}
vim.opt.colorcolumn = "100"
vim.api.nvim_create_autocmd({"VimResized"}, {pattern = {"*"}, command = 'exe "normal! \\<c-w>="'})
vim.cmd("source ~/.config/nvim/map.vim")
vim.cmd("source ~/.config/nvim/color.vim")
vim.cmd("source ~/.config/nvim/fold.vim")
local plug = vim.fn["plug#"]
vim.fn["plug#begin"]("~/.config/nvim/plugged")
plug("JulesWang/css.vim")
plug("NoahTheDuke/vim-just")
plug("cespare/vim-toml", {branch="main"})
plug("hashivim/vim-terraform")
plug("hrsh7th/cmp-nvim-lsp")
plug("hrsh7th/cmp-vsnip")
plug("hrsh7th/nvim-cmp")
plug("hrsh7th/vim-vsnip")
plug("junegunn/fzf", {["do"]=vim.fn["fzf#install"]})
plug("junegunn/fzf.vim")
plug("justinj/vim-pico8-syntax")
plug("kshenoy/vim-signature")
plug("lotabout/skim.vim")
plug("mileszs/ack.vim")
plug("mitsuhiko/vim-jinja")
plug("neovim/nvim-lspconfig")
plug("niklasl/vim-rdf")
plug("othree/html5.vim")
plug("pangloss/vim-javascript")
plug("pest-parser/pest.vim")
plug("plasticboy/vim-markdown")
plug("preservim/nerdtree")
plug("rust-lang/rust.vim")
plug("tpope/vim-surround")
plug("xtfc/mold.vim")
vim.fn["plug#end"]()
-- LSP config
local lspconfig = require("lspconfig")
lspconfig.pyright.setup({})
-- lspconfig.lua_ls.setup({})
-- disable treesitter for lua files
vim.api.nvim_create_autocmd(
{"BufEnter"},
{pattern = "*.lua", callback = function(ev) vim.treesitter.stop() end}
)
-- autocomplete
local cmp = require("cmp")
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
end,
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<Tab>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
})
})