nvim: split off Lua config files
This commit is contained in:
parent
a756f7b22c
commit
2b67f24ee0
@ -164,35 +164,12 @@ Plug 'axieax/urlview.nvim'
|
|||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
lua << EOF
|
" copy URL under cursor to clipboard bind
|
||||||
require'nvim-treesitter.configs'.setup {
|
|
||||||
ensure_installed = { "c", "cpp", "javascript", "python", "vim", "latex", "fish", "bash" },
|
|
||||||
sync_install = false,
|
|
||||||
auto_install = false,
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
|
|
||||||
disable = function(lang, buf)
|
|
||||||
local max_filesize = 100 * 1024 -- 100 KB
|
|
||||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
|
||||||
if ok and stats and stats.size > max_filesize then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
lua << EOF
|
|
||||||
require("urlview").setup({
|
|
||||||
jump = {
|
|
||||||
prev = "<leader>uj",
|
|
||||||
next = "<leader>uh",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
EOF
|
|
||||||
:nnoremap <silent><leader>uu :let @+ = expand('<cfile>')<CR>
|
:nnoremap <silent><leader>uu :let @+ = expand('<cfile>')<CR>
|
||||||
|
|
||||||
|
" see .config/nvim/lua/init.lua
|
||||||
|
lua require('init')
|
||||||
|
|
||||||
" Code folding
|
" Code folding
|
||||||
set foldmethod=expr
|
set foldmethod=expr
|
||||||
set foldexpr=nvim_treesitter#foldexpr()
|
set foldexpr=nvim_treesitter#foldexpr()
|
||||||
|
25
src/.config/nvim/lua/init.lua
Normal file
25
src/.config/nvim/lua/init.lua
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
-- Syntax highlighting
|
||||||
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
ensure_installed = { "c", "cpp", "javascript", "python", "vim", "latex", "fish", "bash" },
|
||||||
|
sync_install = false,
|
||||||
|
auto_install = false,
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
|
||||||
|
disable = function(lang, buf)
|
||||||
|
local max_filesize = 100 * 1024 -- 100 KB
|
||||||
|
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||||
|
if ok and stats and stats.size > max_filesize then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- motions to hop between URLs fast
|
||||||
|
require("urlview").setup({
|
||||||
|
jump = {
|
||||||
|
prev = "<leader>uj",
|
||||||
|
next = "<leader>uh",
|
||||||
|
},
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user