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
7a218dbc
Commit
7a218dbc
authored
Apr 05, 2021
by
Tim van Deurzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update plugins, keybindings and settings extensively.
parent
f633aca1
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
236 additions
and
164 deletions
+236
-164
neovim/init.lua
neovim/init.lua
+2
-1
neovim/lua/keybindings/compe.lua
neovim/lua/keybindings/compe.lua
+16
-12
neovim/lua/keybindings/init.lua
neovim/lua/keybindings/init.lua
+2
-103
neovim/lua/keybindings/utility.lua
neovim/lua/keybindings/utility.lua
+42
-41
neovim/lua/keybindings/which_key.lua
neovim/lua/keybindings/which_key.lua
+18
-0
neovim/lua/lsp/init.lua
neovim/lua/lsp/init.lua
+12
-1
neovim/lua/plugins/init.lua
neovim/lua/plugins/init.lua
+91
-6
neovim/lua/treesitter/init.lua
neovim/lua/treesitter/init.lua
+53
-0
No files found.
neovim/init.lua
View file @
7a218dbc
-- Load all the configuration modules
-- Load all the configuration modules
require
(
"core"
)
require
(
"core"
)
require
(
"keybindings"
)
require
(
"plugins"
)
require
(
"plugins"
)
require
(
"lsp"
)
require
(
"lsp"
)
require
(
"
keybindings
"
)
require
(
"
treesitter
"
)
neovim/lua/keybindings/compe.lua
View file @
7a218dbc
...
@@ -17,6 +17,8 @@ end
...
@@ -17,6 +17,8 @@ end
_G
.
tab_complete
=
function
()
_G
.
tab_complete
=
function
()
if
vim
.
fn
.
pumvisible
()
==
1
then
if
vim
.
fn
.
pumvisible
()
==
1
then
return
t
"<C-n>"
return
t
"<C-n>"
elseif
vim
.
fn
.
call
(
"vsnip#available"
,
{
1
})
==
1
then
return
t
"<Plug>(vsnip-expand-or-jump)"
elseif
check_back_space
()
then
elseif
check_back_space
()
then
return
t
"<Tab>"
return
t
"<Tab>"
else
else
...
@@ -26,6 +28,8 @@ end
...
@@ -26,6 +28,8 @@ end
_G
.
s_tab_complete
=
function
()
_G
.
s_tab_complete
=
function
()
if
vim
.
fn
.
pumvisible
()
==
1
then
if
vim
.
fn
.
pumvisible
()
==
1
then
return
t
"<C-p>"
return
t
"<C-p>"
elseif
vim
.
fn
.
call
(
"vsnip#jumpable"
,
{
-
1
})
==
1
then
return
t
"<Plug>(vsnip-jump-prev)"
else
else
return
t
"<S-Tab>"
return
t
"<S-Tab>"
end
end
...
...
neovim/lua/keybindings/init.lua
View file @
7a218dbc
require
(
'keybindings.compe'
)
require
(
'keybindings.compe'
)
require
(
'keybindings.which_key'
)
require
(
'keybindings.which_key'
)
--- local bind = require('keybindings.utility')
vim
.
api
.
nvim_set_keymap
(
"i"
,
"<c-x><c-s>"
,
"<Esc><Cmd>w<CR>a"
,
{
silent
=
true
,
nowait
=
true
})
--- local map_cr = bind.map_cr
vim
.
api
.
nvim_set_keymap
(
"n"
,
"<c-x><c-s>"
,
"<Cmd>w<CR>"
,
{
silent
=
true
})
--- local map_cu = bind.map_cu
--- local map_cmd = bind.map_cmd
--- local map_args = bind.map_args
---
--- local mappings = {
--- ["n|<Leader>pu"] = map_cr("PackerUpdate"):with_silent():with_noremap():with_nowait(),
--- ["n|<Leader>ps"] = map_cr("PackerSync"):with_silent():with_noremap():with_nowait(),
--- ["n|<Leader>bb"] = map_cu("Telescope buffers"):with_noremap():with_silent(),
--- ["n|<Leader>ee"] = map_cu("Telescope file_browser"):with_noremap():with_silent(),
--- ["n|<Leader>ma"] = map_cu("Lspsaga code_action"):with_noremap():with_silent(),
--- ["n|<Leader>tt"] = map_cr("NvimTreeToggle"):with_noremap():with_silent(),
---
--- ["i|<CR>"] = map_cmd([[compe#confirm('<CR>')]]):with_noremap():with_expr():with_nowait(),
---
--- -- ["i|<CR>"] = map_cmd([[compe#confirm({ 'keys': "\<Plug>delimitMateCR", 'mode': '' })]]):with_noremap():with_expr():with_nowait(),
--- -- -- person keymap
--- -- ["n|mf"] = map_cr("<cmd>lua require('internal.fsevent').file_event()<CR>"):with_silent():with_nowait():with_noremap();
--- -- ["n|gb"] = map_cr("BufferLinePick"):with_noremap():with_silent(),
--- -- -- Packer
--- -- ["n|<leader>pu"] = map_cr("PackerUpdate"):with_silent():with_noremap():with_nowait();
--- -- ["n|<leader>pi"] = map_cr("PackerInstall"):with_silent():with_noremap():with_nowait();
--- -- ["n|<leader>pc"] = map_cr("PackerCompile"):with_silent():with_noremap():with_nowait();
--- -- -- Lsp mapp work when insertenter and lsp start
--- -- ["n|<leader>li"] = map_cr("LspInfo"):with_noremap():with_silent():with_nowait(),
--- -- ["n|<leader>ll"] = map_cr("LspLog"):with_noremap():with_silent():with_nowait(),
--- -- ["n|<leader>lr"] = map_cr("LspRestart"):with_noremap():with_silent():with_nowait(),
--- -- ["n|<C-f>"] = map_cmd("<cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<CR>"):with_silent():with_noremap():with_nowait(),
--- -- ["n|<C-b>"] = map_cmd("<cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<CR>"):with_silent():with_noremap():with_nowait(),
--- -- ["n|[e"] = map_cr('Lspsaga diagnostic_jump_next'):with_noremap():with_silent(),
--- -- ["n|]e"] = map_cr('Lspsaga diagnostic_jump_prev'):with_noremap():with_silent(),
--- -- ["n|K"] = map_cr("Lspsaga hover_doc"):with_noremap():with_silent(),
--- -- ["n|ga"] = map_cr("Lspsaga code_action"):with_noremap():with_silent(),
--- -- ["v|ga"] = map_cu("Lspsaga range_code_action"):with_noremap():with_silent(),
--- -- ["n|gd"] = map_cr('Lspsaga preview_definition'):with_noremap():with_silent(),
--- -- ["n|gD"] = map_cmd("<cmd>lua vim.lsp.buf.implementation()<CR>"):with_noremap():with_silent(),
--- -- ["n|gs"] = map_cr('Lspsaga signature_help'):with_noremap():with_silent(),
--- -- ["n|gr"] = map_cr('Lspsaga rename'):with_noremap():with_silent(),
--- -- ["n|gh"] = map_cr('Lspsaga lsp_finder'):with_noremap():with_silent(),
--- -- ["n|gt"] = map_cmd("<cmd>lua vim.lsp.buf.type_definition()<CR>"):with_noremap():with_silent(),
--- -- ["n|<Leader>cw"] = map_cmd("<cmd>lua vim.lsp.buf.workspace_symbol()<CR>"):with_noremap():with_silent(),
--- -- ["n|<Leader>ce"] = map_cr('Lspsaga show_line_diagnostics'):with_noremap():with_silent(),
--- -- ["n|<Leader>ct"] = map_args("Template"),
--- -- ["n|<Leader>tf"] = map_cu('DashboardNewFile'):with_noremap():with_silent(),
--- -- -- Plugin nvim-tree
--- -- ["n|<Leader>e"] = map_cr('NvimTreeToggle'):with_noremap():with_silent(),
--- -- ["n|<Leader>F"] = map_cr('NvimTreeFindFile'):with_noremap():with_silent(),
--- -- -- Plugin MarkdownPreview
--- -- ["n|<Leader>om"] = map_cu('MarkdownPreview'):with_noremap():with_silent(),
--- -- -- Plugin DadbodUI
--- -- ["n|<Leader>od"] = map_cr('DBUIToggle'):with_noremap():with_silent(),
--- -- -- Plugin Floaterm
--- -- ["n|<A-d>"] = map_cu('Lspsaga open_floaterm'):with_noremap():with_silent(),
--- -- ["t|<A-d>"] = map_cu([[<C-\><C-n>:Lspsaga close_floaterm<CR>]]):with_noremap():with_silent(),
--- -- ["n|<Leader>g"] = map_cu("Lspsaga open_floaterm lazygit"):with_noremap():with_silent(),
--- -- -- Far.vim
--- -- ["n|<Leader>fz"] = map_cr('Farf'):with_noremap():with_silent();
--- -- ["v|<Leader>fz"] = map_cr('Farf'):with_noremap():with_silent();
--- -- -- Plugin Telescope
--- -- ["n|<Leader>bb"] = map_cu('Telescope buffers'):with_noremap():with_silent(),
--- -- ["n|<Leader>fa"] = map_cu('DashboardFindWord'):with_noremap():with_silent(),
--- -- ["n|<Leader>fb"] = map_cu('Telescope file_browser'):with_noremap():with_silent(),
--- -- ["n|<Leader>ff"] = map_cu('DashboardFindFile'):with_noremap():with_silent(),
--- -- ["n|<Leader>fg"] = map_cu('Telescope git_files'):with_noremap():with_silent(),
--- -- ["n|<Leader>fw"] = map_cu('Telescope grep_string'):with_noremap():with_silent(),
--- -- ["n|<Leader>fh"] = map_cu('DashboardFindHistory'):with_noremap():with_silent(),
--- -- ["n|<Leader>fl"] = map_cu('Telescope loclist'):with_noremap():with_silent(),
--- -- ["n|<Leader>fc"] = map_cu('Telescope git_commits'):with_noremap():with_silent(),
--- -- ["n|<Leader>ft"] = map_cu('Telescope help_tags'):with_noremap():with_silent(),
--- -- ["n|<Leader>fd"] = map_cu('Telescope dotfiles path='..os.getenv("HOME")..'/.dotfiles'):with_noremap():with_silent(),
--- -- ["n|<Leader>fs"] = map_cu('Telescope gosource'):with_noremap():with_silent(),
--- -- -- prodoc
--- -- ["n|gcc"] = map_cu('ProComment'):with_noremap():with_silent(),
--- -- ["x|gcc"] = map_cr('ProComment'),
--- -- ["n|gcj"] = map_cu('ProDoc'):with_silent():with_silent(),
--- -- -- Plugin acceleratedjk
--- -- ["n|j"] = map_cmd('v:lua.enhance_jk_move("j")'):with_silent():with_expr(),
--- -- ["n|k"] = map_cmd('v:lua.enhance_jk_move("k")'):with_silent():with_expr(),
--- -- -- Plugin QuickRun
--- -- ["n|<Leader>r"] = map_cr("<cmd> lua require'internal.quickrun'.run_command()"):with_noremap():with_silent(),
--- -- -- Plugin Vista
--- -- ["n|<Leader>v"] = map_cu('Vista'):with_noremap():with_silent(),
--- -- -- Plugin vim-operator-surround
--- -- ["n|sa"] = map_cmd("<Plug>(operator-surround-append)"):with_silent(),
--- -- ["n|sd"] = map_cmd("<Plug>(operator-surround-delete)"):with_silent(),
--- -- ["n|sr"] = map_cmd("<Plug>(operator-surround-replace)"):with_silent(),
--- -- -- Plugin hrsh7th/vim-eft
--- -- ["n|;"] = map_cmd("v:lua.enhance_ft_move(';')"):with_expr(),
--- -- ["x|;"] = map_cmd("v:lua.enhance_ft_move(';')"):with_expr(),
--- -- ["n|f"] = map_cmd("v:lua.enhance_ft_move('f')"):with_expr(),
--- -- ["x|f"] = map_cmd("v:lua.enhance_ft_move('f')"):with_expr(),
--- -- ["o|f"] = map_cmd("v:lua.enhance_ft_move('f')"):with_expr(),
--- -- ["n|F"] = map_cmd("v:lua.enhance_ft_move('F')"):with_expr(),
--- -- ["x|F"] = map_cmd("v:lua.enhance_ft_move('F')"):with_expr(),
--- -- ["o|F"] = map_cmd("v:lua.enhance_ft_move('F')"):with_expr(),
--- -- -- Plugin vim_niceblock
--- -- ["x|I"] = map_cmd("v:lua.enhance_nice_block('I')"):with_expr(),
--- -- ["x|gI"] = map_cmd("v:lua.enhance_nice_block('gI')"):with_expr(),
--- -- ["x|A"] = map_cmd("v:lua.enhance_nice_block('A')"):with_expr(),
--- };
---
--- bind.nvim_load_mapping(mappings)
neovim/lua/keybindings/utility.lua
View file @
7a218dbc
local
rhs_options
=
{}
local
rhs_options
=
{}
vim
.
api
.
nvim_set_keymap
(
""
)
function
rhs_options
:
new
()
function
rhs_options
:
new
()
local
instance
=
{
local
instance
=
{
cmd
=
''
,
cmd
=
''
,
...
...
neovim/lua/keybindings/which_key.lua
View file @
7a218dbc
...
@@ -4,6 +4,7 @@ local keymap = {
...
@@ -4,6 +4,7 @@ local keymap = {
f
=
{
f
=
{
name
=
'+file'
,
name
=
'+file'
,
f
=
{
'<Cmd>Telescope file_browser<CR>'
,
'browser'
},
f
=
{
'<Cmd>Telescope file_browser<CR>'
,
'browser'
},
t
=
{
'<Cmd>NvimTreeToggle<CR>'
,
'tree'
},
},
},
b
=
{
b
=
{
...
@@ -16,6 +17,23 @@ local keymap = {
...
@@ -16,6 +17,23 @@ local keymap = {
u
=
{
'<Cmd>PackerUpdate<CR>'
,
'update'
},
u
=
{
'<Cmd>PackerUpdate<CR>'
,
'update'
},
s
=
{
'<Cmd>PackerSync<CR>'
,
'sync'
},
s
=
{
'<Cmd>PackerSync<CR>'
,
'sync'
},
},
},
l
=
{
name
=
'+lsp'
,
a
=
{
'<Cmd>Lspsaga code_action<CR>'
,
'code action'
},
r
=
{
'<Cmd>Lspsaga rename<CR>'
,
'rename'
},
s
=
{
'<Cmd>Lspsaga lsp_finder<CR>'
,
'find'
},
p
=
{
'<Cmd>Lspsaga preview_definition<CR>'
,
'preview definition'
},
f
=
{
'<Cmd>lua vim.lsp.buf.formatting()<CR>'
,
'format'
},
},
t
=
{
name
=
'+telescope'
,
p
=
{
'<Cmd>Telescope project<CR>'
,
'projects'
},
}
}
}
wk
.
register_keymap
(
'leader'
,
keymap
)
wk
.
register_keymap
(
'leader'
,
keymap
)
...
...
neovim/lua/lsp/init.lua
View file @
7a218dbc
require
(
'lspconfig'
).
gopls
.
setup
{}
local
lsp_config
=
require
(
'lspconfig'
)
local
capabilities
=
vim
.
lsp
.
protocol
.
make_client_capabilities
()
capabilities
.
textDocument
.
completion
.
completionItem
.
snippetSupport
=
true
lsp_config
.
gopls
.
setup
{
capabilities
=
capabilities
,
}
lsp_config
.
rust_analyzer
.
setup
{
capabilities
=
capabilities
,
}
neovim/lua/plugins/init.lua
View file @
7a218dbc
...
@@ -5,13 +5,19 @@ return require('packer').startup(function()
...
@@ -5,13 +5,19 @@ return require('packer').startup(function()
use
{
use
{
'morhetz/gruvbox'
,
'morhetz/gruvbox'
,
config
=
function
()
--
config = function()
vim
.
cmd
[[colo gruvbox]]
--
vim.cmd[[colo gruvbox]]
end
--
end
}
}
use
'icymind/NeoSolarized'
use
'icymind/NeoSolarized'
use
'romgrk/doom-one.vim'
use
{
'romgrk/doom-one.vim'
,
-- config = function()
-- vim.cmd[[colo doom-one]]
-- end
}
-- UI
-- UI
use
'ntpeters/vim-better-whitespace'
use
'ntpeters/vim-better-whitespace'
...
@@ -62,6 +68,14 @@ return require('packer').startup(function()
...
@@ -62,6 +68,14 @@ return require('packer').startup(function()
};
};
}
}
end
,
end
,
requires
=
{
{
'hrsh7th/vim-vsnip'
,
requires
=
{
'hrsh7th/vim-vsnip-integ'
}
}
}
}
}
use
'kyazdani42/nvim-tree.lua'
use
'kyazdani42/nvim-tree.lua'
use
{
use
{
...
@@ -71,13 +85,46 @@ return require('packer').startup(function()
...
@@ -71,13 +85,46 @@ return require('packer').startup(function()
-- Utilities
-- Utilities
use
'editorconfig/editorconfig-vim'
use
'editorconfig/editorconfig-vim'
use
{
'tjdevries/colorbuddy.vim'
,
{
'nvim-treesitter/nvim-treesitter'
,
opt
=
true
}}
use
'tjdevries/colorbuddy.vim'
use
{
'nvim-treesitter/nvim-treesitter'
,
run
=
':TSUpdate'
,
requires
=
{
'nvim-treesitter/nvim-treesitter-refactor'
,
'nvim-treesitter/nvim-treesitter-textobjects'
},
}
use
{
'tjdevries/gruvbuddy.nvim'
,
config
=
function
()
require
(
'colorbuddy'
).
colorscheme
(
'gruvbuddy'
)
end
}
use
{
use
{
'nvim-telescope/telescope.nvim'
,
'nvim-telescope/telescope.nvim'
,
requires
=
{{
'nvim-lua/popup.nvim'
},
{
'nvim-lua/plenary.nvim'
}}
requires
=
{
{
'nvim-lua/popup.nvim'
},
{
'nvim-lua/plenary.nvim'
},
{
'nvim-telescope/telescope-project.nvim'
}
},
config
=
function
()
require
(
'telescope'
).
load_extension
(
'project'
)
end
}
}
use
'Chiel92/vim-autoformat'
use
'Chiel92/vim-autoformat'
use
'Raimondi/delimitMate'
use
{
'Shougo/echodoc.vim'
,
config
=
function
()
vim
.
cmd
(
[[let g:echodoc#enable_at_startup = 1]]
)
end
}
-- LSP
-- LSP
use
'neovim/nvim-lspconfig'
use
'neovim/nvim-lspconfig'
...
@@ -95,4 +142,42 @@ return require('packer').startup(function()
...
@@ -95,4 +142,42 @@ return require('packer').startup(function()
require
(
'lspsaga'
).
init_lsp_saga
()
require
(
'lspsaga'
).
init_lsp_saga
()
end
end
}
}
use
{
'kosayoda/nvim-lightbulb'
,
config
=
function
()
require
(
'nvim-lightbulb'
).
update_lightbulb
{
sign
=
{
enabled
=
true
,
-- Priority of the gutter sign
priority
=
10
,
},
float
=
{
enabled
=
true
,
-- Text to show in the popup float
text
=
"💡"
,
-- Available keys for window options:
-- - height of floating window
-- - width of floating window
-- - wrap_at character to wrap at for computing height
-- - max_width maximal width of floating window
-- - max_height maximal height of floating window
-- - pad_left number of columns to pad contents at left
-- - pad_right number of columns to pad contents at right
-- - pad_top number of lines to pad contents at top
-- - pad_bottom number of lines to pad contents at bottom
-- - offset_x x-axis offset of the floating window
-- - offset_y y-axis offset of the floating window
-- - anchor corner of float to place at the cursor (NW, NE, SW, SE)
-- - winblend transparency of the window (0-100)
win_opts
=
{},
},
virtual_text
=
{
enabled
=
false
,
-- Text to show at virtual text
text
=
"💡"
,
}
}
end
}
end
)
end
)
neovim/lua/treesitter/init.lua
0 → 100644
View file @
7a218dbc
local
ts_configs
=
require
(
'nvim-treesitter.configs'
)
ts_configs
.
setup
{
ensure_installed
=
{
'bash'
,
'bibtex'
,
'c'
,
'comment'
,
'cpp'
,
'css'
,
'go'
,
'haskell'
,
'html'
,
'javascript'
,
'json'
,
'jsonc'
,
'julia'
,
'kotlin'
,
'latex'
,
'lua'
,
'ocaml'
,
'ocaml_interface'
,
'python'
,
'regex'
,
'rust'
,
'teal'
,
'toml'
,
'typescript'
,
'yaml'
,
'zig'
},
highlight
=
{
enable
=
true
,
use_languagetree
=
true
},
indent
=
{
enable
=
false
},
incremental_selection
=
{
enable
=
true
,
keymaps
=
{
init_selection
=
'gnn'
,
node_incremental
=
'grn'
,
scope_incremental
=
'grc'
,
node_decremental
=
'grm'
}
},
refactor
=
{
smart_rename
=
{
enable
=
true
,
keymaps
=
{
smart_rename
=
"grr"
}},
highlight_definitions
=
{
enable
=
true
}
-- highlight_current_scope = { enable = true }
},
textobjects
=
{
select
=
{
enable
=
true
,
keymaps
=
{
[
'iF'
]
=
{
python
=
'(function_definition) @function'
,
cpp
=
'(function_definition) @function'
,
c
=
'(function_definition) @function'
,
java
=
'(method_declaration) @function'
},
-- or you use the queries from supported languages with textobjects.scm
[
'af'
]
=
'@function.outer'
,
[
'if'
]
=
'@function.inner'
,
[
'aC'
]
=
'@class.outer'
,
[
'iC'
]
=
'@class.inner'
,
[
'ac'
]
=
'@conditional.outer'
,
[
'ic'
]
=
'@conditional.inner'
,
[
'ae'
]
=
'@block.outer'
,
[
'ie'
]
=
'@block.inner'
,
[
'al'
]
=
'@loop.outer'
,
[
'il'
]
=
'@loop.inner'
,
[
'is'
]
=
'@statement.inner'
,
[
'as'
]
=
'@statement.outer'
,
[
'ad'
]
=
'@comment.outer'
,
[
'am'
]
=
'@call.outer'
,
[
'im'
]
=
'@call.inner'
}
}
}
}
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