diff --git a/src/.config/nvim/init.vim b/src/.config/nvim/init.vim index 644a703..c21097f 100755 --- a/src/.config/nvim/init.vim +++ b/src/.config/nvim/init.vim @@ -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 = "uj", - next = "uh", - }, -}) -EOF +" copy URL under cursor to clipboard bind :nnoremap uu :let @+ = expand('') +" see .config/nvim/lua/init.lua +lua require('init') + " Code folding set foldmethod=expr set foldexpr=nvim_treesitter#foldexpr() diff --git a/src/.config/nvim/lua/init.lua b/src/.config/nvim/lua/init.lua new file mode 100644 index 0000000..2a8b2e7 --- /dev/null +++ b/src/.config/nvim/lua/init.lua @@ -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 = "uj", + next = "uh", + }, +})