-
-
Notifications
You must be signed in to change notification settings - Fork 155
Expand file tree
/
Copy pathinit.lua
More file actions
68 lines (57 loc) · 1.9 KB
/
init.lua
File metadata and controls
68 lines (57 loc) · 1.9 KB
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
-- Define the plugin directory variable (s:plugin_dir in VimScript)
local plugin_dir = vim.fn.expand('~/.local/share/nvim/site/pack/vendor/start')
-- set rtp+=.
vim.opt.rtp:append('.')
-- execute 'set rtp^=' . s:plugin_dir . '/plenary.nvim'
-- execute 'set rtp^=' . s:plugin_dir . '/nvim-treesitter'
-- execute 'set rtp^=' . s:plugin_dir . '/nvim-lspconfig'
vim.opt.rtp:prepend(plugin_dir .. '/plenary.nvim')
vim.opt.rtp:prepend(plugin_dir .. '/nvim-treesitter')
vim.opt.rtp:prepend(plugin_dir .. '/nvim-lspconfig')
-- runtime! plugin/plenary.vim
-- runtime! plugin/nvim-treesitter.vim
-- runtime! plugin/playground.vim
-- runtime! plugin/nvim-lspconfig.vim
vim.cmd('runtime! plugin/plenary.vim')
vim.cmd('runtime! plugin/nvim-treesitter.vim')
vim.cmd('runtime! plugin/playground.vim')
vim.cmd('runtime! plugin/nvim-lspconfig.vim')
-- Option settings (set noswapfile, set nobackup, etc.)
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.writebackup = false
vim.opt.autoindent = false
vim.opt.cindent = false
vim.opt.smartindent = false
vim.opt.indentexpr = ''
vim.opt.shada = 'NONE'
-- filetype indent off
vim.cmd('filetype indent off')
-- Lua configuration block
_G.test_rename = true
_G.test_close = true
-- require("plenary/busted")
require('plenary.busted')
-- require("go").setup({...})
require('go').setup({
gofmt = 'gofumpt',
goimports = 'goimports',
verbose = true,
log_path = vim.fn.expand('$HOME') .. '/tmp/gonvim.log',
lsp_cfg = true,
})
vim.lsp.enable('gopls')
require('nvim-treesitter').setup({
-- Directory to install parsers and queries to
install_dir = vim.fn.stdpath('data') .. '/site',
})
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'go' },
callback = function()
local queries = require('nvim-treesitter.config').get_installed('queries')
if not vim.tbl_contains(queries, 'go') then
error('No queries for go found')
end
pcall(vim.treesitter.start)
end,
})