Vim Plugins and Pathogen The Complete Guide Answered 2022 Droidrant
Vim Plugins and Pathogen The Complete Guide [Answered 2022]- Droidrant Skip to Content ……………same as NERDTree-o. double-click…….same as the NERDTree-o map. middle-click…….same as NERDTree-i for files, same as NERDTree-e for dirs. D…….Delete the current bookmark ………………………..NERDTree-D P…….Jump to the root node………………………………NERDTree-P p…….Jump to current nodes parent………………………..NERDTree-p K…….Jump up inside directories at the current tree depth…..NERDTree-K J…….Jump down inside directories at the current tree depth…NERDTree-J …Jump down to the next sibling of the current directory…NERDTree-C-J …Jump up to the previous sibling of the current directory.NERDTree-C-K C…….Change the tree root to the selected dir……………..NERDTree-C u…….Move the tree root up one directory………………….NERDTree-u U…….Same as ‘u’ except the old root node is left open……..NERDTree-U r…….Recursively refresh the current directory…………….NERDTree-r R…….Recursively refresh the current root…………………NERDTree-R m…….Display the NERD tree menu………………………….NERDTree-m cd……Change the CWD to the dir of the selected node………..NERDTree-cd CD……Change tree root to the CWD…………………………NERDTree-CD I…….Toggle whether hidden files displayed………………..NERDTree-I f…….Toggle whether the file filters are used……………..NERDTree-f F…….Toggle whether files are displayed…………………..NERDTree-F B…….Toggle whether the bookmark table is displayed………..NERDTree-B q…….Close the NERDTree window…………………………..NERDTree-q A…….Zoom (maximize/minimize) the NERDTree window………….NERDTree-A ?…….Toggle the display of the quick help…………………NERDTree-? —————————————————————————– [/alert-announce] Check out NERDtree plugin on Github. Recently used files from directory – List recently modified files from the current directory recursively. The list can also be filtered. Default: Recently used files: List recently used files. The list can also be filtered. Default: Sessions: List all your sessions from a certain directory, when you’ve made them with the in-built session commands. Default: ~/.vim/session Bookmarks – Define bookmarks, thus entries for files that will always be listed. Again appears when you define them. Default: Custom footer: Same as the custom header.. but at the bottom. Default:
Using :mksession in Vim to save a Session.vim file to the current directory will show the session as an option in the Startify menu. It will be shown at the top of all lists as entry [0] . The vim-startify inbuilt session commands can also be used to place saved session files in the ~/.vim/sessions/ folder. These inbuilt session commands are: :SLoad – Load a session. :SSave – Save a session. :Delete – Delete a session.
Vim Plugins and Pathogen The Complete Guide
By: Author DroidRant Editors Posted on Published: January 17, 2020 Categories Tricks Of The Trades Vim does a lot with its base install and provides everything you’d expect from a CLI text editor, but to unlock even further awesomeness one needs to delve into the vast libraries of plugins on offer. One such site that aims to index these plugins is: http://vimawesome.com/ Which is awesome in its own right. To install said plugins there are several varying install solutions on offer (Vundle, NeoBundle, VimPlug, Pathogen, etc). In this post I’ll follow the most basic method of using Pathogen to install Vim plugins, whilst highlighting and describing a list of my own thus far installed and used plugins. Related Questions / Contents1 – Install Pathogen2 – Edit vimrc3 – Install PluginsSuperTabNERD TreeBookmarksNERD tree MappingsSyntasticfugitive vimgoyo vimlimelight vimvim-startifyStartify LayoutNavigating StartifyExtra Startify Variableseunuch-vimvim-wordygist-vim1 – Install Pathogen
Start by making the two configuration directories in your user’s home directory, here’s how to do this: [alert-announce] $ mkdir -p ~/.vim/autoload ~/.vim/bundle && \ [/alert-announce] Now in the prompt that’s initiated from the last command retrieve the contents of the two new folders with Curl: [alert-announce] > curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim [/alert-announce] Install Curl first if you don’t have it install it on Debian/Ubuntu with: [alert-announce] $ sudo apt-get install curl [/alert-announce] Or on Arch Linux with: [alert-announce] $ sudo pacman -S curl [/alert-announce] Check out Pathogen plugin manager on Github.2 – Edit vimrc
After returning to the command line continue by opening your ~/.vimrc file for writing: [alert-announce] $ vim ~/.vimrc [/alert-announce] Then add these two lines to run Pathogen and enable plugins: [alert-announce] ~/.vimrc execute pathogen#infect() filetype plugin indent on [/alert-announce] Save and quit.3 – Install Plugins
Any plugins I use I’ll add details about here in this section.vim-markdown
To install vim-markdown use these two commands on your system (with Git installed): [alert-announce] $ cd ~/.vim/bundle && \ > git clone git://github.com/plasticboy/vim-markdown.git [/alert-announce] To disable the “folding” in markdown files provided by vim-markdown add this line to your ~/.vimrc config file: [alert-announce] ~/.vimrc let g:vim_markdown_folding_disabled=1 [/alert-announce] Commands :Toc create a quickfix vertical window navigable table of contents with the headers. :Toch Same as :Toc but in an horizontal window. :Toct Same as :Toc but in a new tab. :Tocv: Same as :Toc for symmetry with :Toch and :TocvSuperTab
SuperTab is an auto-completion plugin that allows extra insert mode completion using the key. After typing a few letters of a word that exists within the current open buffer (vim session) SuperTab will list the auto-completion options it. [alert-announce] $ git clone https://github.com/ervandew/supertab.git ~/.vim/bundle/supertab [/alert-announce]NERD Tree
NERD tree allows you to explore your filesystem in order to easily open files and directories. It takes the form of a tree which you manipulate with the keyboard and/or mouse. It also supports basic filesystem operations. [alert-announce] $ git clone https://github.com/scrooloose/nerdtree ~/.vim/bundle/supertab [/alert-announce] Include this next line in your ~/.vimrc to stop garbled characters and broken directory traversing in your NERDTree.: [alert-announce] ~/.vimrc let NERDTreeDirArrows = 0 [/alert-announce]Running NERD Tree
To start a tree in the currently opened file’s directory type this into Vim: [alert-announce] :NERDTree [/alert-announce] To do the same but commence the tree in a separate directory, specify the directory path like this: [alert-announce] :NERDTree /etc/X11/Xresources/ [/alert-announce] To close the tree in the current tab use: [alert-announce] :NERDTreeClose [/alert-announce] To quickly find the current file in the tree: [alert-announce] :NERDTreeFind [/alert-announce]Bookmarks
When the NERD Tree window/tab is active you can type the next command in the current buffer, to bookmark a file or directory that is currently highlighted by the tree. [alert-announce] :Bookmark bookmark_name [/alert-announce] Opening bookmark is done with: [alert-announce] :OpenBookmark bookmark_name [/alert-announce] If you need to remove a bookmark then use [alert-announce] :ClearBookmarks bookmark_name bookmark_name bookmark_name [/alert-announce] Note: If no bookmark names are passed then this will remove all bookmarks on the current node. Any previous bookmarks made with NERDTree can be used to start the tree by providing the bookmark name. The second command in this next example provides auto-completion when typing out the bookmark name, both commands have the same result, however: [alert-announce] :NERDTree bookmark_name :NERDTreeFromBookmark bookmark_name [/alert-announce]NERD tree Mappings
[alert-announce] —————————————————————————– 2.3. NERD tree Mappings *NERDTreeMappings* Default Description~ help-tag~ Key~ o…….Open files, directories and bookmarks………………..NERDTree-o go……Open selected file, but leave cursor in the NERDTree…..NERDTree-go t…….Open selected node/bookmark in a new tab……………..NERDTree-t T…….Same as ‘t’ but keep the focus on the current tab……..NERDTree-T i…….Open selected file in a split window…………………NERDTree-i gi……Same as i, but leave the cursor on the NERDTree……….NERDTree-gi s…….Open selected file in a new vsplit…………………..NERDTree-s gs……Same as s, but leave the cursor on the NERDTree……….NERDTree-gs O…….Recursively open the selected directory………………NERDTree-O x…….Close the current nodes parent………………………NERDTree-x X…….Recursively close all children of the current node…….NERDTree-X e…….Edit the current dir……………………………….NERDTree-eSyntastic
This is a syntax checking plugin for Vim that runs files through various external syntax checkers to display any resulting errors to the user. This can be done on demand if needed, or automatically as files are saved. If syntax errors are detected, the user is notified and is happy because they didn’t have to compile their code or execute their script to find them! Here are the languages it has built in support for: “ActionScript, Ada, API Blueprint, AppleScript, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, Markdown, MATLAB, Mercury, NASM, Nix, Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and iOS property lists, Puppet, Python, R, Racket, Relax NG, reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope Page Templates, and Zsh.” Install the plugin with Pathogen as usual via: [alert-announce] $ git clone https://github.com/scrooloose/syntastic.git ~/.vim/bundle/syntastic [/alert-announce] Include these new lines in your ~/.vimrc to ensure Syntastic works and displays its content properly: [alert-announce] ~/.vimrc let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 set statusline+=\ %=%#warningmsg# set statusline+=\ %=%{SyntasticStatuslineFlag()} set statusline+=\ %=%* [/alert-announce] Check out Syntastic Plugin on Githubfugitive vim
“Fugitive.vim may very well be the best Git wrapper of all time.” This plugin adds a whole new set of commands to Vim to make using Git smoother, flexible, more varied, and all from within the Vim session in question. Install it as usual with: [alert-announce] $ git clone https://github.com/tpope/vim-fugitive.git ~/.vim/bundle/vim-fugitive [/alert-announce] Note: The percent symbol (%) is short-hand for the path of the current file.Base Fugitive Commands
Git fugitive vim Action :Git add % :Gwrite Stage the current file to the index :Git checkout % :Gread Revert current file to last checked in version :Git rm % :Gremove Delete the current file and the corresponding Vim buffer :Git mv % :Gmove Rename the current file and the corresponding Vim buffer :Git commit :Gcommit Opens up a split window to enter a commit message and features Vim’s auto-completion functionality (CTRL + N). :wq and ENTER to confirm. :Git blame % :Gblame Opens a vertically split window containing annotations for each line of the file: the last commit reference, with author and timestamp. When you scroll one, the other window follows. :Git status :Gstatus Opens a split window with status, that is interact-able. CNTRL+N & CNTRL + P moves between files names listed, pressing - minus whilst untracked files are highlighted will add it to the index, - on the added modified files will remove them from the index. You can highlight multiple files with visual mode. p on a highlighted file opens up the specific file changes. ENTER opens the highlighted file in the window beneath :Git diff % :Gdiff Shows current individual file’s insertions or removals in comparison to indexed version. Check out fugitive vim Plugin on Githubgoyo vim
Distraction-free writing tool that sets the writing dimensions suitable for non-technical and non-programming contexts. It also removes any unnecessary interface elements from the Vim UI. Works well with the limelight vim plugin is shown after this one. Install it from Github with: [alert-announce] $ git clone https://github.com/junegunn/goyo vim.git ~/.vim/bundle/goyo vim [/alert-announce] Toggle Goyo on: [alert-announce] :Goyo [/alert-announce] Toggle Goyo off: [alert-announce] :Goyo! [/alert-announce] Toggle Goyo on but with a specific width: [alert-announce] width :Goyo 120 [/alert-announce] Or with a specific height: [alert-announce] height :Goyo x30 [/alert-announce] Both a specific width and height work too: [alert-announce] both :Goyo 120×30 [/alert-announce] Percentages can be passed instead: [alert-announce] percentage :Goyo 120×30% [/alert-announce] Defaults can be set in your ~/.vimrc file via: [alert-announce] ~/.vimrc g:goyo_width (default: 80) g:goyo_height (default: 85%) g:goyo_linenr (default: 0) [/alert-announce] Check out goyo vim Plugin on Githublimelight vim
Allows you to focus and highlight blocks of text and content dynamically, useful for writing oriented environments. Works well with the previous Goyo plugin. Install with Pathogen as normal: [alert-announce] $ git clone https://github.com/junegunn/limelight vim.git ~/.vim/bundle/limelight vim [/alert-announce] Turn Limelight on: [alert-announce] :Limelight [/alert-announce] Turn Limelight on at a specific brightness, can use any value between 0.0 ~ 1.0 where the higher the value the brighter/darker it is: [alert-announce] :Limelight0.3 [/alert-announce] Turn Limelight off: [alert-announce] :Limelight! [/alert-announce] Check out limelight vim Plugin on Githubvim-startify
This plugin provides an awesome start menu that can be seen whenever Vim is called on its own without any arguments or piped text. Install with Pathogen as normal: [alert-announce] $ git clone https://github.com/mhinz/vim-startify.git ~/.vim/bundle/vim-startify.vim [/alert-announce] Run Vim in a terminal to see the plugin: [alert-announce] $ vim [/alert-announce]Startify Layout
This is the layout of Startify and how it organises its content by default: Custom header – How about some ASCII art action? Perhaps even dynamically generated? Default:Navigating Startify
Navigating the menu can be done by using the usual Vim keys j k or just by keying in whatever is written between the square brackets on that line. You can also double-click anywhere on a line to highlight the paths. Moreover, you can open several files at once if needed. Whilst the cursor is on an entry hit either: b – Opens in same window, s – Open in a split window. t – Open in a tab. There is also e for creating an empty buffer (new file), and i for creating an empty buffer and jumping into insert mode straight away, and then q for quitting the menu. You can always reopen the Stratify screen via :Startify inside a Vim session. ##Startify SessionsUsing :mksession in Vim to save a Session.vim file to the current directory will show the session as an option in the Startify menu. It will be shown at the top of all lists as entry [0] . The vim-startify inbuilt session commands can also be used to place saved session files in the ~/.vim/sessions/ folder. These inbuilt session commands are: :SLoad – Load a session. :SSave – Save a session. :Delete – Delete a session.