nvim: split off Lua config files

This commit is contained in:
dogeystamp 2023-04-11 20:54:53 -04:00
parent a756f7b22c
commit 2b67f24ee0
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 29 additions and 27 deletions

View File

@ -164,35 +164,12 @@ Plug 'axieax/urlview.nvim'
call plug#end()
lua << EOF
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
" copy URL under cursor to clipboard bind
:nnoremap <silent><leader>uu :let @+ = expand('<cfile>')<CR>
" see .config/nvim/lua/init.lua
lua require('init')
" Code folding
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()

View 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",
},
})