mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
4 Commits
a9afd05a98
...
dbb8190a93
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbb8190a93 | ||
|
|
ce1e13e2c9 | ||
|
|
4d289d16b3 | ||
|
|
90a0645d42 |
@ -64,7 +64,7 @@ and how to set up on different platforms (Linux, macOS, and Windows).
|
|||||||
+ Better escaping from insert mode via [better-escape.vim](https://github.com/nvim-zh/better-escape.vim).
|
+ Better escaping from insert mode via [better-escape.vim](https://github.com/nvim-zh/better-escape.vim).
|
||||||
+ Ultra-fast project-wide fuzzy searching via [LeaderF](https://github.com/Yggdroot/LeaderF).
|
+ Ultra-fast project-wide fuzzy searching via [LeaderF](https://github.com/Yggdroot/LeaderF).
|
||||||
+ Faster code commenting via [vim-commentary](https://github.com/tpope/vim-commentary).
|
+ Faster code commenting via [vim-commentary](https://github.com/tpope/vim-commentary).
|
||||||
+ Faster matching pair insertion and jump via [delimitMate](https://github.com/Raimondi/delimitMate).
|
+ Faster matching pair insertion and jump via [nvim-autopairs](https://github.com/windwp/nvim-autopairs).
|
||||||
+ Smarter and faster matching pair management (add, replace or delete) via [vim-sandwich](https://github.com/machakann/vim-sandwich).
|
+ Smarter and faster matching pair management (add, replace or delete) via [vim-sandwich](https://github.com/machakann/vim-sandwich).
|
||||||
+ Fast buffer jump via [hop.nvim](https://github.com/phaazon/hop.nvim).
|
+ Fast buffer jump via [hop.nvim](https://github.com/phaazon/hop.nvim).
|
||||||
+ Powerful snippet insertion via [Ultisnips](https://github.com/SirVer/ultisnips).
|
+ Powerful snippet insertion via [Ultisnips](https://github.com/SirVer/ultisnips).
|
||||||
|
|||||||
@ -34,6 +34,3 @@ function s:create_term_buf(_type, size) abort
|
|||||||
endif
|
endif
|
||||||
execute 'resize ' . a:size
|
execute 'resize ' . a:size
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" For delimitMate
|
|
||||||
let b:delimitMate_matchpairs = "(:),[:],{:}"
|
|
||||||
|
|||||||
@ -1,6 +1,2 @@
|
|||||||
" let the initial folding state be that all folds are closed.
|
" let the initial folding state be that all folds are closed.
|
||||||
set foldlevel=0
|
setlocal foldlevel=0
|
||||||
|
|
||||||
" Use nvim-treesitter for folding
|
|
||||||
set foldmethod=expr
|
|
||||||
set foldexpr=nvim_treesitter#foldexpr()
|
|
||||||
|
|||||||
@ -4,9 +4,6 @@ set formatoptions-=r
|
|||||||
|
|
||||||
nnoremap <buffer><silent> <F9> :luafile %<CR>
|
nnoremap <buffer><silent> <F9> :luafile %<CR>
|
||||||
|
|
||||||
" For delimitMate
|
|
||||||
let b:delimitMate_matchpairs = "(:),[:],{:}"
|
|
||||||
|
|
||||||
" Use nvim-treesitter for folding
|
" Use nvim-treesitter for folding
|
||||||
set foldmethod=expr
|
set foldmethod=expr
|
||||||
set foldexpr=nvim_treesitter#foldexpr()
|
set foldexpr=nvim_treesitter#foldexpr()
|
||||||
|
|||||||
@ -13,9 +13,6 @@ set softtabstop=4 " number of spaces in tab when editing
|
|||||||
set shiftwidth=4 " number of spaces to use for autoindent
|
set shiftwidth=4 " number of spaces to use for autoindent
|
||||||
set expandtab " expand tab to spaces so that tabs are spaces
|
set expandtab " expand tab to spaces so that tabs are spaces
|
||||||
|
|
||||||
" For delimitMate
|
|
||||||
let b:delimitMate_matchpairs = "(:),[:],{:}"
|
|
||||||
|
|
||||||
" Use nvim-treesitter for folding
|
" Use nvim-treesitter for folding
|
||||||
set foldmethod=expr
|
set foldmethod=expr
|
||||||
set foldexpr=nvim_treesitter#foldexpr()
|
set foldexpr=nvim_treesitter#foldexpr()
|
||||||
|
|||||||
22
lua/config/ufo.lua
Normal file
22
lua/config/ufo.lua
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
local keymap = vim.keymap
|
||||||
|
|
||||||
|
-- disable foldcolumn, see https://github.com/kevinhwang91/nvim-ufo/issues/4
|
||||||
|
vim.o.foldcolumn = '0'
|
||||||
|
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
|
||||||
|
vim.o.foldlevelstart = 99
|
||||||
|
vim.o.foldenable = true -- Don't set nofoldenable in ftplugin
|
||||||
|
|
||||||
|
-- treesitter as a main provider instead
|
||||||
|
-- Only depend on `nvim-treesitter/queries/filetype/folds.scm`,
|
||||||
|
-- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()`
|
||||||
|
require('ufo').setup({
|
||||||
|
provider_selector = function(bufnr, filetype, buftype)
|
||||||
|
return {'treesitter', 'indent'}
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
local ufo = require('ufo')
|
||||||
|
keymap.set('n', 'zR', ufo.openAllFolds, { desc = 'Open all folds' })
|
||||||
|
keymap.set('n', 'zM', ufo.closeAllFolds, { desc = 'Close all folds' })
|
||||||
|
keymap.set('n', 'zr', ufo.openFoldsExceptKinds, { desc = 'Fold less' })
|
||||||
|
keymap.set('n', 'zm', ufo.closeFoldsWith, { desc = 'Fold more' })
|
||||||
@ -50,7 +50,7 @@ local plugin_specs = {
|
|||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
enabled = function()
|
enabled = function()
|
||||||
if vim.g.is_mac then
|
if vim.g.is_mac or vim.g.is_linux then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
@ -221,7 +221,11 @@ local plugin_specs = {
|
|||||||
}, event = "InsertEnter" },
|
}, event = "InsertEnter" },
|
||||||
|
|
||||||
-- Automatic insertion and deletion of a pair of characters
|
-- Automatic insertion and deletion of a pair of characters
|
||||||
{ "Raimondi/delimitMate", event = "InsertEnter" },
|
{
|
||||||
|
'windwp/nvim-autopairs',
|
||||||
|
event = "InsertEnter",
|
||||||
|
config = true
|
||||||
|
},
|
||||||
|
|
||||||
-- Comment plugin
|
-- Comment plugin
|
||||||
{ "tpope/vim-commentary", event = "VeryLazy" },
|
{ "tpope/vim-commentary", event = "VeryLazy" },
|
||||||
@ -488,6 +492,14 @@ local plugin_specs = {
|
|||||||
require("config.fidget-nvim")
|
require("config.fidget-nvim")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'kevinhwang91/nvim-ufo',
|
||||||
|
dependencies = {'kevinhwang91/promise-async'},
|
||||||
|
event = { "VeryLazy" },
|
||||||
|
config = function()
|
||||||
|
require("config.ufo")
|
||||||
|
end
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- configuration for lazy itself.
|
-- configuration for lazy itself.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user