Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dotfiles
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tim van Deurzen
dotfiles
Commits
b10c54d8
Commit
b10c54d8
authored
Nov 10, 2021
by
Tim van Deurzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated keybindings and settings for Neovim.
parent
d58a3608
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
689 additions
and
449 deletions
+689
-449
neovim/lua/keybindings/compe.lua
neovim/lua/keybindings/compe.lua
+115
-41
neovim/lua/lsp/init.lua
neovim/lua/lsp/init.lua
+401
-179
neovim/lua/plugins/init.lua
neovim/lua/plugins/init.lua
+173
-229
No files found.
neovim/lua/keybindings/compe.lua
View file @
b10c54d8
local
t
=
function
(
str
)
local
lspkind
=
require
(
"lspkind"
)
return
vim
.
api
.
nvim_replace_termcodes
(
str
,
true
,
true
,
true
)
lspkind
.
init
()
end
local
check_back_space
=
function
()
local
has_words_before
=
function
()
local
col
=
vim
.
fn
.
col
(
'.'
)
-
1
local
line
,
col
=
unpack
(
vim
.
api
.
nvim_win_get_cursor
(
0
))
if
col
==
0
or
vim
.
fn
.
getline
(
'.'
):
sub
(
col
,
col
):
match
(
'%s'
)
then
return
col
~=
0
and
vim
.
api
.
nvim_buf_get_lines
(
0
,
line
-
1
,
line
,
true
)[
1
]:
sub
(
col
,
col
):
match
(
"%s"
)
==
nil
return
true
else
return
false
end
end
end
-- Use (s-)tab to:
local
luasnip
=
require
(
"luasnip"
)
--- move to prev/next item in completion menuone
local
cmp_autopairs
=
require
(
"nvim-autopairs.completion.cmp"
)
--- jump to prev/next snippet's placeholder
_G
.
tab_complete
=
function
()
local
cmp
=
require
(
"cmp"
)
if
vim
.
fn
.
pumvisible
()
==
1
then
cmp
.
setup
({
return
t
"<C-n>"
completion
=
{
elseif
vim
.
fn
.
call
(
"vsnip#available"
,
{
1
})
==
1
then
completeopt
=
"menu,menuone,noinsert"
,
return
t
"<Plug>(vsnip-expand-or-jump)"
},
elseif
check_back_space
()
then
return
t
"<Tab>"
mapping
=
{
[
"<C-d>"
]
=
cmp
.
mapping
.
scroll_docs
(
-
4
),
[
"<C-f>"
]
=
cmp
.
mapping
.
scroll_docs
(
2
),
[
"<C-e>"
]
=
cmp
.
mapping
.
close
(),
[
"<c-y>"
]
=
cmp
.
mapping
.
confirm
({
behavior
=
cmp
.
ConfirmBehavior
.
Insert
,
select
=
true
,
}),
[
"<c-q>"
]
=
cmp
.
mapping
.
confirm
({
behavior
=
cmp
.
ConfirmBehavior
.
Replace
,
select
=
true
,
}),
[
"<CR>"
]
=
cmp
.
mapping
.
confirm
({
select
=
true
}),
[
"<Tab>"
]
=
cmp
.
mapping
(
function
(
fallback
)
if
cmp
.
visible
()
then
cmp
.
select_next_item
()
elseif
luasnip
.
expand_or_jumpable
()
then
luasnip
.
expand_or_jump
()
elseif
has_words_before
()
then
cmp
.
complete
()
else
else
return
vim
.
fn
[
'compe#complete'
]
()
fallback
()
end
end
end
end
,
{
_G
.
s_tab_complete
=
function
()
"i"
,
if
vim
.
fn
.
pumvisible
()
==
1
then
"s"
,
return
t
"<C-p>"
}),
elseif
vim
.
fn
.
call
(
"vsnip#jumpable"
,
{
-
1
})
==
1
then
return
t
"<Plug>(vsnip-jump-prev)"
[
"<S-Tab>"
]
=
cmp
.
mapping
(
function
(
fallback
)
if
cmp
.
visible
()
then
cmp
.
select_prev_item
()
elseif
luasnip
.
jumpable
(
-
1
)
then
luasnip
.
jump
(
-
1
)
else
else
return
t
"<S-Tab>"
fallback
()
end
end
end
end
,
{
"i"
,
"s"
,
}),
},
-- Youtube:
-- the order of your sources matter (by default). That gives them priority
-- you can configure:
-- keyword_length
-- priority
-- max_item_count
-- (more?)
sources
=
{
{
name
=
"nvim_lsp"
},
{
name
=
"nvim_lua"
},
{
name
=
"path"
},
{
name
=
"luasnip"
},
{
name
=
"buffer"
,
keyword_length
=
5
},
},
sorting
=
{
-- TODO: Would be cool to add stuff like "See variable names before method names" in rust, or something like that.
comparators
=
{
cmp
.
config
.
compare
.
offset
,
cmp
.
config
.
compare
.
exact
,
cmp
.
config
.
compare
.
score
,
cmp
.
config
.
compare
.
kind
,
cmp
.
config
.
compare
.
sort_text
,
cmp
.
config
.
compare
.
length
,
cmp
.
config
.
compare
.
order
,
},
},
snippet
=
{
expand
=
function
(
args
)
luasnip
.
lsp_expand
(
args
.
body
)
end
,
},
formatting
=
{
-- Youtube: How to set up nice formatting for your sources.
format
=
lspkind
.
cmp_format
({
with_text
=
true
,
menu
=
{
buffer
=
"[buf]"
,
nvim_lsp
=
"[LSP]"
,
nvim_lua
=
"[api]"
,
path
=
"[path]"
,
luasnip
=
"[snip]"
,
gh_issues
=
"[issues]"
,
},
}),
},
experimental
=
{
-- I like the new menu better! Nice work hrsh7th
native_menu
=
false
,
vim
.
api
.
nvim_set_keymap
(
"i"
,
"<Tab>"
,
"v:lua.tab_complete()"
,
{
expr
=
true
})
-- Let's play with this for a day or two
vim
.
api
.
nvim_set_keymap
(
"s"
,
"<Tab>"
,
"v:lua.tab_complete()"
,
{
expr
=
true
})
ghost_text
=
true
,
vim
.
api
.
nvim_set_keymap
(
"i"
,
"<S-Tab>"
,
"v:lua.s_tab_complete()"
,
{
expr
=
true
})
},
vim
.
api
.
nvim_set_keymap
(
"s"
,
"<S-Tab>"
,
"v:lua.s_tab_complete()"
,
{
expr
=
true
})
})
local
opts
=
{
noremap
=
true
,
silent
=
true
,
expr
=
true
}
cmp
.
event
:
on
(
"confirm_done"
,
cmp_autopairs
.
on_confirm_done
({
map_char
=
{
tex
=
""
}
}))
vim
.
api
.
nvim_set_keymap
(
"i"
,
"<CR>"
,
[[compe#confirm({'keys': "\<Plug>delimitMateCR", 'mode': ''})]]
,
opts
)
vim
.
api
.
nvim_set_keymap
(
"i"
,
"<c-c>"
,
[[compe#complete()]]
,
opts
)
vim
.
api
.
nvim_set_keymap
(
"i"
,
"<c-e>"
,
[[compe#close('<c-e>')]]
,
opts
)
neovim/lua/lsp/init.lua
View file @
b10c54d8
local
lsp_config
=
require
(
'lspconfig'
)
local
lsp_config
=
require
(
"lspconfig"
)
local
capabilities
=
vim
.
lsp
.
protocol
.
make_client_capabilities
()
local
capabilities
=
vim
.
lsp
.
protocol
.
make_client_capabilities
()
capabilities
=
require
(
"cmp_nvim_lsp"
).
update_capabilities
(
capabilities
)
capabilities
.
textDocument
.
completion
.
completionItem
.
snippetSupport
=
true
capabilities
.
textDocument
.
completion
.
completionItem
.
snippetSupport
=
true
lsp_config
.
gopls
.
setup
{
lsp_config
.
gopls
.
setup
(
{
capabilities
=
capabilities
,
capabilities
=
capabilities
,
settings
=
{
settings
=
{
gopls
=
{
gopls
=
{
...
@@ -18,9 +19,13 @@ lsp_config.gopls.setup{
...
@@ -18,9 +19,13 @@ lsp_config.gopls.setup{
bools
=
true
,
bools
=
true
,
},
},
staticcheck
=
true
,
staticcheck
=
true
,
usePlaceholders
=
true
,
codelenses
=
{
gc_details
=
true
,
},
},
},
},
}
},
})
-- lsp_config.rust_analyzer.setup{
-- lsp_config.rust_analyzer.setup{
-- capabilities = capabilities,
-- capabilities = capabilities,
...
@@ -51,14 +56,14 @@ local opts = {
...
@@ -51,14 +56,14 @@ local opts = {
runnables
=
{
runnables
=
{
-- whether to use telescope for selection menu or not
-- whether to use telescope for selection menu or not
use_telescope
=
true
use_telescope
=
true
,
-- rest of the opts are forwarded to telescope
-- rest of the opts are forwarded to telescope
},
},
debuggables
=
{
debuggables
=
{
-- whether to use telescope for selection menu or not
-- whether to use telescope for selection menu or not
use_telescope
=
true
use_telescope
=
true
,
-- rest of the opts are forwarded to telescope
-- rest of the opts are forwarded to telescope
},
},
...
@@ -105,59 +110,63 @@ local opts = {
...
@@ -105,59 +110,63 @@ local opts = {
-- the border that is used for the hover window
-- the border that is used for the hover window
-- see vim.api.nvim_open_win()
-- see vim.api.nvim_open_win()
border
=
{
border
=
{
{
"╭"
,
"FloatBorder"
},
{
"─"
,
"FloatBorder"
},
{
"╭"
,
"FloatBorder"
},
{
"╮"
,
"FloatBorder"
},
{
"│"
,
"FloatBorder"
},
{
"─"
,
"FloatBorder"
},
{
"╯"
,
"FloatBorder"
},
{
"─"
,
"FloatBorder"
},
{
"╮"
,
"FloatBorder"
},
{
"╰"
,
"FloatBorder"
},
{
"│"
,
"FloatBorder"
}
{
"│"
,
"FloatBorder"
},
{
"╯"
,
"FloatBorder"
},
{
"─"
,
"FloatBorder"
},
{
"╰"
,
"FloatBorder"
},
{
"│"
,
"FloatBorder"
},
},
},
-- whether the hover action window gets automatically focused
-- whether the hover action window gets automatically focused
auto_focus
=
false
auto_focus
=
false
,
}
},
},
},
-- all the opts to send to nvim-lspconfig
-- all the opts to send to nvim-lspconfig
-- these override the defaults set by rust-tools.nvim
-- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
-- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
server
=
{}
-- rust-analyer options
server
=
{},
-- rust-analyer options
}
}
require
(
'rust-tools'
).
setup
(
opts
)
require
(
"rust-tools"
).
setup
(
opts
)
lsp_config
.
angularls
.
setup
{
lsp_config
.
angularls
.
setup
(
{
capabilities
=
capabilities
,
capabilities
=
capabilities
,
}
}
)
lsp_config
.
yamlls
.
setup
{
lsp_config
.
yamlls
.
setup
(
{
capabilities
=
capabilities
,
capabilities
=
capabilities
,
}
}
)
lsp_config
.
dartls
.
setup
{}
lsp_config
.
dartls
.
setup
({})
lsp_config
.
ccls
.
setup
{
lsp_config
.
ccls
.
setup
(
{
capabilities
=
capabilities
,
capabilities
=
capabilities
,
}
}
)
lsp_config
.
sumneko_lua
.
setup
{
lsp_config
.
sumneko_lua
.
setup
(
{
cmd
=
{
'/usr/bin/lua-language-server'
},
cmd
=
{
"/usr/bin/lua-language-server"
},
capabilities
=
capabilities
,
capabilities
=
capabilities
,
settings
=
{
settings
=
{
Lua
=
{
Lua
=
{
runtime
=
{
runtime
=
{
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version
=
'LuaJIT'
,
version
=
"LuaJIT"
,
-- Setup your lua path
-- Setup your lua path
path
=
vim
.
split
(
package.path
,
';'
),
path
=
vim
.
split
(
package.path
,
";"
),
},
},
diagnostics
=
{
diagnostics
=
{
-- Get the language server to recognize the `vim` global
-- Get the language server to recognize the `vim` global
globals
=
{
'vim'
},
globals
=
{
"vim"
},
},
},
workspace
=
{
workspace
=
{
-- Make the server aware of Neovim runtime files
-- Make the server aware of Neovim runtime files
library
=
{
library
=
{
[
vim
.
fn
.
expand
(
'$VIMRUNTIME/lua'
)]
=
true
,
[
vim
.
fn
.
expand
(
"$VIMRUNTIME/lua"
)]
=
true
,
[
vim
.
fn
.
expand
(
'$VIMRUNTIME/lua/vim/lsp'
)]
=
true
,
[
vim
.
fn
.
expand
(
"$VIMRUNTIME/lua/vim/lsp"
)]
=
true
,
},
},
},
},
-- Do not send telemetry data containing a randomized but unique identifier
-- Do not send telemetry data containing a randomized but unique identifier
...
@@ -166,34 +175,32 @@ lsp_config.sumneko_lua.setup{
...
@@ -166,34 +175,32 @@ lsp_config.sumneko_lua.setup{
},
},
},
},
},
},
}
})
local
eslint
=
{
local
eslint
=
{
lintCommand
=
"eslint_d -f unix --stdin --stdin-filename ${INPUT}"
,
lintCommand
=
"eslint_d -f unix --stdin --stdin-filename ${INPUT}"
,
lintStdin
=
true
,
lintStdin
=
true
,
lintFormats
=
{
"%f:%l:%c: %m"
},
lintFormats
=
{
"%f:%l:%c: %m"
},
lintIgnoreExitCode
=
true
,
lintIgnoreExitCode
=
true
,
formatCommand
=
"eslint_d --fix-to-stdout --stdin --stdin-filename=${INPUT}"
,
formatCommand
=
"eslint_d --fix-to-stdout --stdin --stdin-filename=${INPUT}"
,
formatStdin
=
true
formatStdin
=
true
,
}
}
lsp_config
.
efm
.
setup
({
lsp_config
.
efm
.
setup
{
init_options
=
{
documentFormatting
=
true
},
init_options
=
{
documentFormatting
=
true
},
filetypes
=
{
"javascript"
,
"typescript"
},
filetypes
=
{
"javascript"
,
"typescript"
},
root_dir
=
function
(
fname
)
root_dir
=
function
(
fname
)
return
lsp_config
.
util
.
root_pattern
(
"tsconfig.json"
)(
fname
)
or
return
lsp_config
.
util
.
root_pattern
(
"tsconfig.json"
)(
fname
)
lsp_config
.
util
.
root_pattern
(
".eslintrc.js"
,
".git"
)(
fname
);
or
lsp_config
.
util
.
root_pattern
(
".eslintrc.js"
,
".git"
)(
fname
)
end
,
end
,
settings
=
{
settings
=
{
rootMarkers
=
{
".eslintrc.js"
,
".git/"
},
rootMarkers
=
{
".eslintrc.js"
,
".git/"
},
languages
=
{
languages
=
{
javascript
=
{
eslint
},
javascript
=
{
eslint
},
typescript
=
{
eslint
}
typescript
=
{
eslint
},
}
},
}
},
}
}
)
-- vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
-- vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
-- vim.lsp.diagnostic.on_publish_diagnostics, {
-- vim.lsp.diagnostic.on_publish_diagnostics, {
...
@@ -208,22 +215,237 @@ lsp_config.efm.setup {
...
@@ -208,22 +215,237 @@ lsp_config.efm.setup {
-- }
-- }
-- )
-- )
require
(
'lsp_signature'
).
on_attach
({
-- require('lsp_signature').on_attach({
bind
=
true
,
-- This is mandatory, otherwise border config won't get registered.
-- bind = true, -- This is mandatory, otherwise border config won't get registered.
-- If you want to hook lspsaga or other signature handler, pls set to false
-- -- If you want to hook lspsaga or other signature handler, pls set to false
doc_lines
=
4
,
-- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
-- doc_lines = 4, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
-- set to 0 if you do not want any API comments be shown
-- -- set to 0 if you do not want any API comments be shown
-- This setting only take effect in insert mode, it does not affect signature help in normal
-- -- This setting only take effect in insert mode, it does not affect signature help in normal
-- mode
-- -- mode
--
hint_enable
=
true
,
-- virtual hint enable
-- hint_enable = true, -- virtual hint enable
hint_prefix
=
"↑ "
,
-- Panda for parameter
-- hint_prefix = "↑ ", -- Panda for parameter
hint_scheme
=
"String"
,
-- hint_scheme = "String",
use_lspsaga
=
false
,
-- set to true if you want to use lspsaga popup
-- use_lspsaga = false, -- set to true if you want to use lspsaga popup
handler_opts
=
{
-- handler_opts = {
border
=
"shadow"
-- double, single, shadow, none
-- border = "shadow" -- double, single, shadow, none
},
-- },
decorator
=
{
"`"
,
"`"
}
-- decoractor can be `decorator = {"***", "***"}` `decorator = {"**", "**"}` `decorator = {"**_", "_**"}`
-- decorator = {"`", "`"} -- decoractor can be `decorator = {"***", "***"}` `decorator = {"**", "**"}` `decorator = {"**_", "_**"}`
-- `decorator = {"*", "*"} see markdown help for more details
-- -- `decorator = {"*", "*"} see markdown help for more details
-- <u></u> ~ ~ does not supported by nvim
-- -- <u></u> ~ ~ does not supported by nvim
-- })
if
vim
.
g
.
snippets
~=
"luasnip"
then
return
end
local
ls
=
require
(
"luasnip"
)
ls
.
config
.
set_config
({
history
=
true
,
updateevents
=
"TextChanged,TextChangedI"
,
})
})
-- create snippet
-- s(context, nodes, condition, ...)
local
snippet
=
ls
.
s
local
snippet_from_nodes
=
ls
.
sn
-- This a choice snippet. You can move through with <c-e> (in my config)
-- tbl_snip {
-- trig = "c",
-- t { "-- this has a choice: " },
-- c(1, { t {"hello"}, t {"world"}, }),
-- i(0),
-- }
local
c
=
ls
.
c
-- choice node
local
f
=
ls
.
f
-- function node
local
i
=
ls
.
i
-- insert node
local
t
=
ls
.
t
-- text node
local
d
=
ls
.
d
-- dynamic node
local
str
=
function
(
text
)
return
t
({
text
})
end
local
newline
=
function
(
text
)
return
t
({
""
,
text
})
end
local
str_snip
=
function
(
trig
,
expanded
)
return
ls
.
parser
.
parse_snippet
({
trig
=
trig
},
expanded
)
end
local
tbl_snip
=
function
(
t
)
return
snippet
({
trig
=
t
.
trig
,
dscr
=
t
.
desc
},
{
unpack
(
t
)
})
end
local
function
char_count_same
(
c1
,
c2
)
local
line
=
vim
.
api
.
nvim_get_current_line
()
local
_
,
ct1
=
string.gsub
(
line
,
c1
,
""
)
local
_
,
ct2
=
string.gsub
(
line
,
c2
,
""
)
return
ct1
==
ct2
end
local
function
neg
(
fn
,
...
)
return
not
fn
(
...
)
end
-- {{{ Go stuff
local
ts_locals
=
require
(
"nvim-treesitter.locals"
)
local
ts_utils
=
require
(
"nvim-treesitter.ts_utils"
)
local
get_node_text
=
vim
.
treesitter
.
get_node_text
vim
.
treesitter
.
set_query
(
"go"
,
"LuaSnip_Result"
,
[[
[
(method_declaration result: (*) @id)
(function_declaration result: (*) @id)
(func_literal result: (*) @id)
]
]]
)
local
transform
=
function
(
text
,
info
)
if
text
==
"int"
then
return
str
(
"0"
)
elseif
text
==
"error"
then
if
info
then
info
.
index
=
info
.
index
+
1
return
c
(
info
.
index
,
{
str
(
string.format
(
'errors.Wrap(%s, "%s")'
,
info
.
err_name
,
info
.
func_name
)),
str
(
info
.
err_name
),
})
else
return
str
(
"err"
)
end
elseif
text
==
"bool"
then
return
str
(
"false"
)
elseif
string.find
(
text
,
"*"
,
1
,
true
)
then
return
str
(
"nil"
)
end
return
str
(
text
)
end
local
handlers
=
{
[
"parameter_list"
]
=
function
(
node
,
info
)
local
result
=
{}
local
count
=
node
:
named_child_count
()
for
i
=
0
,
count
-
1
do
table.insert
(
result
,
transform
(
get_node_text
(
node
:
named_child
(
i
),
0
),
info
))
if
i
~=
count
-
1
then
table.insert
(
result
,
t
({
", "
}))
end
end
return
result
end
,
[
"type_identifier"
]
=
function
(
node
,
info
)
local
text
=
get_node_text
(
node
,
0
)
return
{
transform
(
text
,
info
)
}
end
,
}
local
function
go_result_type
(
info
)
local
cursor_node
=
ts_utils
.
get_node_at_cursor
()
local
scope
=
ts_locals
.
get_scope_tree
(
cursor_node
,
0
)
local
function_node
for
_
,
v
in
ipairs
(
scope
)
do
if
v
:
type
()
==
"function_declaration"
or
v
:
type
()
==
"method_declaration"
or
v
:
type
()
==
"func_literal"
then
function_node
=
v
break
end
end
local
query
=
vim
.
treesitter
.
get_query
(
"go"
,
"LuaSnip_Result"
)
for
id
,
node
in
query
:
iter_captures
(
function_node
,
0
)
do
if
handlers
[
node
:
type
()]
then
return
handlers
[
node
:
type
()](
node
,
info
)
end
end
end
-- }}}
local
shortcut
=
function
(
val
)
if
type
(
val
)
==
"string"
then
return
{
t
({
val
}),
i
(
0
)
}
end
if
type
(
val
)
==
"table"
then
for
k
,
v
in
ipairs
(
val
)
do
if
type
(
v
)
==
"string"
then
val
[
k
]
=
t
({
v
})
end
end
end
return
val
end
local
make
=
function
(
tbl
)
local
result
=
{}
for
k
,
v
in
pairs
(
tbl
)
do
table.insert
(
result
,
(
snippet
({
trig
=
k
,
desc
=
v
.
desc
},
shortcut
(
v
))))
end
return
result
end
local
same
=
function
(
index
)
return
f
(
function
(
args
)
return
args
[
1
]
end
,
{
index
})
end
local
snippets
=
{}
local
go_ret_vals
=
function
(
args
,
old_state
)
local
info
=
{
index
=
0
,
err_name
=
args
[
1
][
1
],
func_name
=
args
[
2
][
1
]
}
return
snippet_from_nodes
(
nil
,
go_result_type
(
info
))
end
--stylua: ignore
snippets
.
go
=
make
{
main
=
{
t
{
"func main() {"
,
"
\t
"
},
i
(
0
),
t
{
""
,
"}"
},
},
ef
=
{
i
(
1
,
{
"val"
}),
str
", err := "
,
i
(
2
,
{
"f"
}),
str
"("
,
i
(
3
),
str
")"
,
i
(
0
),
},
efi
=
{
i
(
1
,
{
"val"
}),
", "
,
i
(
2
,
{
"err"
}),
" := "
,
i
(
3
,
{
"f"
}),
"("
,
i
(
4
),
")"
,
t
{
""
,
"if "
},
same
(
2
),
t
{
" != nil {"
,
"
\t
return "
},
d
(
5
,
go_ret_vals
,
{
2
,
3
}),
t
{
""
,
"}"
},
i
(
0
),
},
-- TODO: Fix this up so that it actually uses the tree sitter thing
ie
=
{
"if err != nil {"
,
"
\t
return err"
,
i
(
0
),
"}"
},
}
neovim/lua/plugins/init.lua
View file @
b10c54d8
return
require
(
'packer'
).
startup
(
function
()
return
require
(
"packer"
).
startup
(
function
()
use
'wbthomason/packer.nvim'
use
(
"wbthomason/packer.nvim"
)
-- Color schemes
-- Color schemes
use
'morhetz/gruvbox'
use
(
"morhetz/gruvbox"
)
use
'icymind/NeoSolarized'
use
(
"icymind/NeoSolarized"
)
use
'romgrk/doom-one.vim'
use
(
"romgrk/doom-one.vim"
)
use
{
use
(
{
'tjdevries/gruvbuddy.nvim'
,
"tjdevries/gruvbuddy.nvim"
,
requires
=
{
'tjdevries/colorbuddy.vim'
},
requires
=
{
"tjdevries/colorbuddy.vim"
},
config
=
function
()
config
=
function
()
--require('colorbuddy').colorscheme('gruvbox')
--require('colorbuddy').colorscheme('gruvbox')
vim
.
cmd
[[colo gruvbox]]
vim
.
cmd
(
[[colo gruvbox]]
)
end
end
,
}
})
-- UI
-- UI
use
'ntpeters/vim-better-whitespace'
use
(
"ntpeters/vim-better-whitespace"
)
use
'Yggdroot/indentLine'
use
(
"Yggdroot/indentLine"
)
use
'haya14busa/incsearch.vim'
use
(
"haya14busa/incsearch.vim"
)
use
{
use
(
{
'junegunn/fzf.vim'
,
"junegunn/fzf.vim"
,
requires
=
{
'junegunn/fzf'
}
requires
=
{
"junegunn/fzf"
},
}
})
-- Look at feline for a leaner better maintained alternative.
-- Look at feline for a leaner better maintained alternative.
use
{
use
(
{
'glepnir/galaxyline.nvim'
,
"glepnir/galaxyline.nvim"
,
branch
=
'main'
,
branch
=
"main"
,
config
=
function
()
config
=
function
()
require
(
'statusline'
)
require
(
"statusline"
)
end
,
end
,
requires
=
{
'kyazdani42/nvim-web-devicons'
}
requires
=
{
"kyazdani42/nvim-web-devicons"
},
}
})
use
'liuchengxu/vista.vim'
use
(
"liuchengxu/vista.vim"
)
use
'kyazdani42/nvim-tree.lua'
use
({
use
{
"kyazdani42/nvim-tree.lua"
,
'AckslD/nvim-whichkey-setup.lua'
,
requires
=
"kyazdani42/nvim-web-devicons"
,
requires
=
{
'liuchengxu/vim-which-key'
}
config
=
function
()
}
require
(
"nvim-tree"
).
setup
({})
use
{
end
,
'akinsho/nvim-bufferline.lua'
,
})
use
({
"AckslD/nvim-whichkey-setup.lua"
,
requires
=
{
"liuchengxu/vim-which-key"
},
})
use
({
"akinsho/nvim-bufferline.lua"
,
requires
=
'kyazdani42/nvim-web-devicons'
,
requires
=
"kyazdani42/nvim-web-devicons"
,
config
=
function
()
config
=
function
()
require
(
'bufferline'
).
setup
{}
require
(
"bufferline"
).
setup
({})
end
end
,
}
})
-- Utilities
-- Utilities
use
'editorconfig/editorconfig-vim'
use
(
"editorconfig/editorconfig-vim"
)
use
{
use
(
{
'nvim-treesitter/nvim-treesitter'
,
"nvim-treesitter/nvim-treesitter"
,
run
=
':TSUpdate'
,
run
=
":TSUpdate"
,
requires
=
{
requires
=
{
'nvim-treesitter/nvim-treesitter-refactor'
,
"nvim-treesitter/nvim-treesitter-refactor"
,
'nvim-treesitter/nvim-treesitter-textobjects'
"nvim-treesitter/nvim-treesitter-textobjects"
,
},
},
}
})
use
{
use
(
{
'nvim-telescope/telescope.nvim'
,
"nvim-telescope/telescope.nvim"
,
requires
=
{
requires
=
{
{
'nvim-lua/popup.nvim'
},
{
"nvim-lua/popup.nvim"
},
{
'nvim-lua/plenary.nvim'
},
{
"nvim-lua/plenary.nvim"
},
{
'nvim-telescope/telescope-project.nvim'
}
{
"nvim-telescope/telescope-project.nvim"
},
},
},
config
=
function
()
config
=
function
()
require
(
'telescope'
).
load_extension
(
'project'
)
require
(
"telescope"
).
load_extension
(
"project"
)
end
end
,
}
})
use
'Chiel92/vim-autoformat'
use
(
"Chiel92/vim-autoformat"
)
use
'Raimondi/delimitMate'
use
(
"Raimondi/delimitMate"
)
use
{
use
({
'Shougo/echodoc.vim'
,
"Shougo/echodoc.vim"
,
config
=
function
()
vim
.
cmd
[[let g:echodoc#enable_at_start=1]]
end
}
-- Completion
use
{
'hrsh7th/nvim-compe'
,
config
=
function
()
config
=
function
()
require
(
'compe'
).
setup
{
vim
.
cmd
(
[[let g:echodoc#enable_at_start=1]]
)
enabled
=
true
;
autocomplete
=
true
;
debug
=
false
;
min_length
=
1
;
preselect
=
'enable'
;
throttle_time
=
80
;
source_timeout
=
200
;
incomplete_delay
=
400
;
max_abbr_width
=
100
;
max_kind_width
=
100
;
max_menu_width
=
100
;
documentation
=
true
;
source
=
{
path
=
true
;
buffer
=
true
;
calc
=
true
;
nvim_lsp
=
true
;
nvim_lua
=
true
;
vsnip
=
true
;
};
}
end
,
end
,
})
requires
=
{
{
'hrsh7th/vim-vsnip'
,
requires
=
{
'hrsh7th/vim-vsnip-integ'
}
}
}
}
-- LSP
-- LSP
use
'neovim/nvim-lspconfig'
use
(
"neovim/nvim-lspconfig"
)
use
{
use
({
'RishabhRD/nvim-lsputils'
,
"RishabhRD/nvim-lsputils"
,
requires
=
{
'RishabhRD/popfix'
},
disable
=
true
}
use
{
'glepnir/lspsaga.nvim'
,
requires
=
{
'neovim/nvim-lspconfig'
},
config
=
function
()
requires
=
{
"RishabhRD/popfix"
},
require
(
'lspsaga'
).
init_lsp_saga
{
disable
=
true
,
error_sign
=
'•'
,
})
warn_sign
=
'•'
,
hint_sign
=
'•'
,
infor_sign
=
'•'
,
code_action_icon
=
'?'
,
border_style
=
2
,
code_action_prompt
=
{
enable
=
true
,
sign
=
true
,
sign_priority
=
20
,
virtual_text
=
false
,
},
code_action_keys
=
{
quit
=
'<esc>'
,
exec
=
'<CR>'
},
finder_action_keys
=
{
open
=
'o'
,
vsplit
=
's'
,
split
=
'i'
,
quit
=
'<esc>'
,
scroll_down
=
'<C-n>'
,
scroll_up
=
'<C-p>'
},
}
-- vim.api.nvim_command [[autocmd CursorHold,CursorHoldI * :lua require('lspsaga.signaturehelp').signature_help()]]
use
({
end
"nvim-lua/lsp_extensions.nvim"
,
}
use
{
'nvim-lua/lsp_extensions.nvim'
,
requires
=
{
'neovim/nvim-lspconfig'
},
requires
=
{
"neovim/nvim-lspconfig"
},
disable
=
true
,
disable
=
true
,
config
=
function
()
config
=
function
()
require
(
'lsp_extensions'
).
inlay_hints
{
require
(
"lsp_extensions"
).
inlay_hints
(
{
highlight
=
"Comment"
,
highlight
=
"Comment"
,
prefix
=
" » "
,
prefix
=
" » "
,
aligned
=
true
,
aligned
=
true
,
only_current_line
=
false
,
only_current_line
=
false
,
enabled
=
{
"ChainingHint"
}
enabled
=
{
"ChainingHint"
},
}
})
end
end
,
}
})
use
{
use
(
{
"folke/lsp-trouble.nvim"
,
"folke/lsp-trouble.nvim"
,
requires
=
"kyazdani42/nvim-web-devicons"
,
requires
=
"kyazdani42/nvim-web-devicons"
,
config
=
function
()
config
=
function
()
require
(
"trouble"
).
setup
{
require
(
"trouble"
).
setup
(
{
-- your configuration comes here
-- your configuration comes here
-- or leave it empty to use the default settings
-- or leave it empty to use the default settings
-- refer to the configuration section below
-- refer to the configuration section below
}
})
end
end
,
}
})
use
{
-- Completion
"ray-x/lsp_signature.nvim"
,
use
(
"onsails/lspkind-nvim"
)
use
(
"hrsh7th/cmp-buffer"
)
use
(
"hrsh7th/cmp-path"
)
use
(
"hrsh7th/cmp-nvim-lua"
)
use
(
"hrsh7th/cmp-nvim-lsp"
)
use
(
"hrsh7th/nvim-cmp"
)
use
({
"saadparwaiz1/cmp_luasnip"
,
-- config = function()
requires
=
{
-- end
"L3MON4D3/LuaSnip"
,
}
},
})
use
{
-- use "hrsh7th/cmp-vsnip"
'simrat39/rust-tools.nvim'
,
-- use "hrsh7th/vim-vsnip"
requires
=
{
use
(
"windwp/nvim-autopairs"
)
'nvim-lua/popup.nvim'
}
}
use
({
"simrat39/rust-tools.nvim"
,
use
{
'lewis6991/gitsigns.nvim'
,
requires
=
{
requires
=
{
'nvim-lua/plenary.nvim'
"nvim-lua/popup.nvim"
,
},
})
use
({
"lewis6991/gitsigns.nvim"
,
requires
=
{
"nvim-lua/plenary.nvim"
,
},
},
config
=
function
()
config
=
function
()
require
(
'gitsigns'
).
setup
()
require
(
"gitsigns"
).
setup
()
end
end
,
}
})
use
'tomlion/vim-solidity'
use
(
"tomlion/vim-solidity"
)
end
)
end
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment