refactor: change hosts to devices and separate hm modules from nix modules
This commit is contained in:
parent
80eec12883
commit
0e4c446438
127 changed files with 36 additions and 51 deletions
common/home/neovim/plugins
16
common/home/neovim/plugins/autopairs.lua
Normal file
16
common/home/neovim/plugins/autopairs.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
-- Auto indent when pressing Enter between brackets
|
||||
local remap = vim.api.nvim_set_keymap
|
||||
local npairs = require('nvim-autopairs')
|
||||
npairs.setup({map_cr=false})
|
||||
|
||||
_G.MUtils= {}
|
||||
|
||||
MUtils.completion_confirm=function()
|
||||
if vim.fn["coc#pum#visible"]() ~= 0 then
|
||||
return vim.fn["coc#pum#confirm"]()
|
||||
else
|
||||
return npairs.autopairs_cr()
|
||||
end
|
||||
end
|
||||
|
||||
remap('i' , '<CR>','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true})
|
10
common/home/neovim/plugins/dracula.vim
Normal file
10
common/home/neovim/plugins/dracula.vim
Normal file
|
@ -0,0 +1,10 @@
|
|||
" set dot icon in place of trailing whitespaces
|
||||
set list listchars=tab:\ \ ,nbsp:␣,trail:•,extends:⟩,precedes:⟨
|
||||
|
||||
|
||||
lua << EOF
|
||||
-- Add visual indicator for trailing whitespaces
|
||||
vim.opt.fillchars = {eob = " "}
|
||||
|
||||
vim.cmd[[colorscheme dracula]]
|
||||
EOF
|
26
common/home/neovim/plugins/indent.lua
Normal file
26
common/home/neovim/plugins/indent.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
local highlight = {
|
||||
"RainbowRed",
|
||||
"RainbowYellow",
|
||||
"RainbowBlue",
|
||||
"RainbowOrange",
|
||||
"RainbowGreen",
|
||||
"RainbowViolet",
|
||||
"RainbowCyan",
|
||||
}
|
||||
local hooks = require('ibl.hooks')
|
||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
|
||||
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
|
||||
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
|
||||
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
|
||||
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
|
||||
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
|
||||
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
|
||||
end)
|
||||
|
||||
require('ibl').setup({
|
||||
indent = {
|
||||
highlight = highlight,
|
||||
char = "▏",
|
||||
},
|
||||
})
|
6
common/home/neovim/plugins/lualine.lua
Normal file
6
common/home/neovim/plugins/lualine.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
require('lualine').setup({
|
||||
options = {
|
||||
theme = 'dracula',
|
||||
globalstatus = true
|
||||
}
|
||||
})
|
23
common/home/neovim/plugins/mini.lua
Normal file
23
common/home/neovim/plugins/mini.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
local map = require('mini.map')
|
||||
map.setup({
|
||||
integrations = {
|
||||
map.gen_integration.builtin_search(),
|
||||
map.gen_integration.gitsigns(),
|
||||
map.gen_integration.diagnostic(),
|
||||
},
|
||||
window = {
|
||||
focusable = true,
|
||||
width = 7,
|
||||
winblend = 75,
|
||||
},
|
||||
})
|
||||
|
||||
local ts_input = require('mini.surround').gen_spec.input.treesitter
|
||||
require('mini.surround').setup({
|
||||
custom_surroundings = {
|
||||
-- Use tree-sitter to search for function call
|
||||
f = {
|
||||
input = ts_input({ outer = '@call.outer', inner = '@call.inner' })
|
||||
},
|
||||
}
|
||||
})
|
37
common/home/neovim/plugins/neotree.lua
Normal file
37
common/home/neovim/plugins/neotree.lua
Normal file
|
@ -0,0 +1,37 @@
|
|||
-- Override netrw
|
||||
vim.g.loaded_netrw = 0
|
||||
vim.g.loaded_netrwPlugin = 0
|
||||
|
||||
require('neo-tree').setup({
|
||||
close_if_last_window = true,
|
||||
enable_refresh_on_write = true,
|
||||
|
||||
window = {
|
||||
width = 22,
|
||||
},
|
||||
|
||||
filesystem = {
|
||||
use_libuv_file_watcher = true,
|
||||
|
||||
filtered_items = {
|
||||
visible = false,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = true,
|
||||
hide_by_name = {},
|
||||
hide_by_pattern = {},
|
||||
always_show = {},
|
||||
never_show = {},
|
||||
never_show_by_pattern = {},
|
||||
},
|
||||
},
|
||||
|
||||
source_selector = {
|
||||
winbar = true,
|
||||
statusline = false
|
||||
},
|
||||
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
leave_dirs_open = true,
|
||||
}
|
||||
})
|
11
common/home/neovim/plugins/neotree.vim
Normal file
11
common/home/neovim/plugins/neotree.vim
Normal file
|
@ -0,0 +1,11 @@
|
|||
" Auto open Neo-Tree on big enough window
|
||||
function! OpenTree() abort
|
||||
if &columns > 100
|
||||
Neotree show
|
||||
Neotree close
|
||||
Neotree show
|
||||
endif
|
||||
lua MiniMap.open()
|
||||
endfunction
|
||||
|
||||
autocmd VimEnter * call OpenTree()
|
13
common/home/neovim/plugins/snippets.vim
Normal file
13
common/home/neovim/plugins/snippets.vim
Normal file
|
@ -0,0 +1,13 @@
|
|||
" use vscode keybinds for snippets completion
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ coc#pum#visible() ? coc#_select_confirm() :
|
||||
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
|
||||
\ CheckBackspace() ? "\<TAB>" :
|
||||
\ coc#refresh()
|
||||
|
||||
function! CheckBackspace() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~# '\s'
|
||||
endfunction
|
||||
|
||||
let g:coc_snippet_next = '<tab>'
|
17
common/home/neovim/plugins/treesitter.vim
Normal file
17
common/home/neovim/plugins/treesitter.vim
Normal file
|
@ -0,0 +1,17 @@
|
|||
lua << EOF
|
||||
|
||||
require('nvim-treesitter.configs').setup({
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true }
|
||||
})
|
||||
|
||||
require('treesitter-context').setup({
|
||||
enable = true,
|
||||
max_lines = 3,
|
||||
min_window_height = 20,
|
||||
})
|
||||
|
||||
EOF
|
||||
|
||||
" Add line under context
|
||||
hi TreesitterContextBottom gui=underline guisp=Grey
|
Loading…
Add table
Add a link
Reference in a new issue