From 75e83b15048f2af865e8ccdc282c7b22fda5210c Mon Sep 17 00:00:00 2001 From: z3rOR0ne Date: Sun, 5 Feb 2023 02:17:16 -0800 Subject: [PATCH] :memo: Enabled folds in nvim --- .config/nvim/lua/neovim/set.lua | 5 ++++- nvim_custom_keys.txt | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/neovim/set.lua b/.config/nvim/lua/neovim/set.lua index d224d2f4..4f78ed3e 100644 --- a/.config/nvim/lua/neovim/set.lua +++ b/.config/nvim/lua/neovim/set.lua @@ -33,7 +33,7 @@ vim.opt.cindent = true vim.opt.tabstop = 8 vim.opt.cursorcolumn = true -- Disable folds -vim.g.nofoldenable = true +-- vim.g.nofoldenable = true -- Fix Splitting vim.opt.splitbelow = true vim.opt.splitright = true @@ -65,6 +65,9 @@ vim.cmd([[autocmd Filetype json let g:indentLine_setConceal = 0]]) -- enable clipboard vim.cmd([[set clipboard+=unnamedplus]]) +-- enable folds +vim.cmd([[set foldmethod=manual]]) + -- enable hard/soft wrap vim.cmd([[set wrap linebreak textwidth=80]]) diff --git a/nvim_custom_keys.txt b/nvim_custom_keys.txt index 9e8da789..f612f5da 100644 --- a/nvim_custom_keys.txt +++ b/nvim_custom_keys.txt @@ -152,6 +152,25 @@ INTERESTING CHAINS :.,$d - Delete every line from the current line to the end of the file :%d - delete every line +# https://neovim.io/doc/user/fold.html +FOLDS (folds condense text in case its alot of text you don't need to see right +now) +:set foldmethod=manual +zf - create +zd - delete +zD - recursive delete +za - toggle fold under cursor +zA - toggle all folds under cursor recursively +zc - close fold under cursor +zo - open fold under cursor +zC - close all folds under cursor recursively +zO - open all folds under cursor recursively +zM - all collapse +zR - all reveal + +IN VISUAL MODE you can select all text you wish to fold by simply highlighting +it then invoking 'zf'. + FROM NORMAL MODE, ENTERING OTHER MODES i - enter INSERT mode at the current cursor position a - enter INSERT mode at the following cursor position (appending)