From 21e4b9373f56c31aef61f2dde526dee582082220 Mon Sep 17 00:00:00 2001 From: Whisker Jones Date: Tue, 28 May 2024 14:35:07 -0600 Subject: [PATCH] updated vim --- tech_docs/linux/vim.md | 86 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/tech_docs/linux/vim.md b/tech_docs/linux/vim.md index 2317fdb..487d440 100644 --- a/tech_docs/linux/vim.md +++ b/tech_docs/linux/vim.md @@ -1213,3 +1213,89 @@ autocmd FileType text setlocal spell " End of .vimrc ``` +--- + +It sounds like Vim is using folding to collapse sections of your Markdown document. You can unfold the document to see all the lines. Here's how you can manage folding in Vim: + +### Unfolding Lines in Vim + +1. **Open your Markdown file in Vim:** + ```sh + vim filename.md + ``` + +2. **Unfold the current fold:** + Press `z` followed by `o` to open the current fold under the cursor. + +3. **Unfold all folds in the document:** + Press `z` followed by `R` to open all folds in the document. + +4. **Close the current fold:** + Press `z` followed by `c` to close the current fold under the cursor. + +5. **Close all folds in the document:** + Press `z` followed by `M` to close all folds in the document. + +### Disable Folding for Markdown Files + +To permanently disable folding for Markdown files, you can add the following line to your `.vimrc` file: + +1. **Open your `.vimrc` file:** + ```sh + vim ~/.vimrc + ``` + +2. **Add the line to disable folding for Markdown files:** + ```vim + let g:vim_markdown_folding_disabled = 1 + ``` + +3. **Save and exit your `.vimrc` file:** + Press `Esc`, then type `:wq` and hit `Enter`. + +### Example `.vimrc` for Markdown + +Here's an example `.vimrc` configuration with folding disabled and other useful settings for Markdown: + +```vim +" Enable syntax highlighting +syntax on + +" Set line numbers +set number + +" Enable filetype detection and plugins +filetype plugin on +filetype indent on + +" Set basic editing settings +set tabstop=4 +set shiftwidth=4 +set expandtab +set autoindent +set smartindent + +" Enable mouse support +set mouse=a + +" Initialize Vim-Plug +call plug#begin('~/.vim/plugged') + +" Markdown plugin for syntax highlighting and other features +Plug 'plasticboy/vim-markdown' + +call plug#end() + +" Disable folding for Markdown files +let g:vim_markdown_folding_disabled = 1 +``` + +### Applying Changes + +After saving your `.vimrc` file with the new settings, restart Vim or source the `.vimrc` file to apply the changes: + +```vim +:source ~/.vimrc +``` + +By following these steps, you should be able to manage and disable folding in Vim, allowing you to see your entire Markdown document without any collapsed sections.