husixu1 / vimrc

A vim configuration (supports Termux)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deprecated. Moved to https://github.com/husixu1/dotfiles-part.

ABOUT

this is an vim config specified for Linux and Termux (an terminal simulator on Android and iOS) to use it, follow the instructions below

TO USE THIS CONFIG

external dependency

package depends on
vim-devicons nerd-font in system font path
vim-fugitive git
vim-merginal git
tagbar ctags
vim-autoctag ctags
DoxygenToolKit doxygen
ctrlsf ack/silver
vim-autoformat any formatter (astyle clang-format ... )
tagbar-markdown php
vimtex texlive; vim built with +clientserver
tagbar-markdown php
vim-livedown livedown (node pack, npm install -g livedown)

manual-installation

  • put all directories into your .vim dir
  • put vimrc in your home dir
  • rename it to .vimrc
  • run curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  • run vim +PlugInstall

use fonts for powerline in terminal vim to display airline arrows correctly

the installation of powerline/fonts might be very slow

frequently-used key mappings

plugin key mapping
Global ; <Leader>
Nerdtree C-n NerdTreeTabsToggle
Vim-indent-guides C-\ IndentGuidesToggle
Tagbar C-t TagBarToggle
Syntastic C-c SyntasticReset
YouCompleteMe S-j,C-j,Down NextCompletion
S-k,C-k,Up PreviousCompletion
C-Space OmniCompletion
<Leader>ji GotoInclude
<Leader>jd GotoDefinition
<Leader>jD GotoDeclaration
UltiSnip Tab UltiSnipTrigger
AutoPair C-w AutoPairsFastWarp
DoxygenToolkit S-m GenerateDox
Agit C-g ShowAgit
VimShell C-s ShowVimShell
EasyMotion <Leader> EasyMotionLeader(ELeader)
<ELeader>s searchOneLetter
<ELeader>S searchMoreLetters
<ELeader>j searchUp
<ELeader>k searchDown
AnyFold(vim buildin) zm,zM foldMore, foldMax
zr,zR reduceFold, unfoldAll
zc,zC closeFold, closeFoldRecurse
zo,zO openFold, openFoldRecurse
RainbowParentheses F9 LoadRainbowParentheses
F10 ToggleRainbowParentheses
Quickr-preveiew <Leader>space QuickfixPreview
UndoTree <Leader>u ToggleUndoTree
CtrlSF <Leader>/ CtrlSFPrompt
vimtex C-q QueryPackageDocument
Buildin F1 PasteToggle
F2 NewTab
F3 CloseCurrentTab
F4 MakeCurrentWindowATab
C-f OpenFileFinder
S-l NextTab
S-h PreviousTab
C-l MoveTabRight
C-h MoveTabLeft
<Leader>C-] CtagJumpAndOpenInNewWindow
z/ ToggleAutoHighlight
C-q QueryInZeal(zeal required)

frequently used commands

plugin command decription
vim-plug :PlugUpdate Update Plugins
:PlugClean Clean Unused Plugins
:PlugInstall Install Plugins
:PlugUpgrade Upgrade Vim-plug Itself
ConqueGdb :Gdb Start ConqueGdb
Syntastic :SyntasticCheck Start SyntasticCheck
:SyntasticToggle Toggle SyntasticCheck
:SyntasticToggle Toggle SyntasticCheck
YouCompleteMe :YcmDebugInfo When Ycm Has Some Problems
LivedownPreview :MarkdownPreview view markdown in browser
vim-autoformat :Autoformat auto-formatting the code

per-project config

  • put a .clang-format in the project root directory and use :Autoformat command to format the code
  • put .syntastic_c/.syntastic_cpp/.syntastic_cuda in the project root directory and add compiler flags to it so syntastic can use custom flag to compile the file. see vimrc file and :h syntastic-checkers for details.

YCM config

  • either-> create your own .ycm_extra_conf.py and put it in ~/.vim/custom

  • or-----> use the ycm_extra_conf.py in this repo insted (do not have to change anything)

  • in the ~/.vim/plugged/YouCompleteMe dir, run python install.py --help for help (usually if you only want C-family complete, run python install.py --clang-completer; and in Termux, run python install.py --clang-completer --system-libclang)

  • once YCM functions normally, it's better to froze it from updating(add 'frozen' to ycm config in .vimrc). Updating YCM is somehow possible to cause a staring failure (fixable, though).

known issues:

  • if Ycm didn't function normally, run :YcmDebugInfo and see corresponding file for debug info.
  • if Ycm suffers an shutdown, please recompile the ycm core.
  • sometimes use system libclang fix the problem (and it's essential for Temux users)
  • if libtinfo missing, install it (from AUR for archlinux users), link it to a correct filename according to the debug info, and recompile ycm core
  • if libtinfo is still missing after the yaourt installation, install ncurses5-compat-libs from AUR

About

A vim configuration (supports Termux)

License:GNU General Public License v3.0


Languages

Language:Vim Snippet 63.8%Language:Vim Script 30.5%Language:Python 5.6%