Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
vim [2019/06/28 18:14]
paul
vim [2019/12/27 05:47] (current)
paul [Airline]
Line 20: Line 20:
     python3-dev ruby-dev lua5.1 lua5.1-dev libperl-dev git     python3-dev ruby-dev lua5.1 lua5.1-dev libperl-dev git
  
-sudo apt-get remove ​Vim Vim-runtime ​gVim Vim-common+sudo apt-get remove ​vim vim-runtime ​gvim vim-common
 </​code>​ </​code>​
  
-Make sure Vim is removed! When you type Vim you should see nothing+Make sure Vim is removed! When you type vim you should see nothing
  
 ==== Compiling ==== ==== Compiling ====
Line 31: Line 31:
 <code bash> <code bash>
 cd  cd 
-git clone https://​github.com/​Vim/Vim.git +git clone https://​github.com/​vim/vim.git 
-cd Vim+cd vim
 git checkout git checkout
  
Line 48: Line 48:
      ​--prefix=/​usr/​local      ​--prefix=/​usr/​local
            
-make VimRUNTIMEDIR=/​usr/​local/​share/​Vim/Vim81 -j8+make vimRUNTIMEDIR=/​usr/​local/​share/​vim/vim81 -j8
 sudo apt install checkinstall sudo apt install checkinstall
 sudo checkinstall sudo checkinstall
  
-sudo update-alternatives --install /​usr/​bin/​editor editor /​usr/​local/​bin/​Vim +sudo update-alternatives --install /​usr/​bin/​editor editor /​usr/​local/​bin/​vim 
-sudo update-alternatives --set editor /​usr/​local/​bin/​Vim  +sudo update-alternatives --set editor /​usr/​local/​bin/​vim  
-sudo update-alternatives --install /usr/bin/vi vi /​usr/​local/​bin/​Vim +sudo update-alternatives --install /usr/bin/vi vi /​usr/​local/​bin/​vim 
-sudo update-alternatives --set vi /​usr/​local/​bin/​Vim+sudo update-alternatives --set vi /​usr/​local/​bin/​vim
 </​code>​ </​code>​
  
 Be sure to change the version when executing the make command. For instance, if the major Vim version is at 8.2, then make line should be: Be sure to change the version when executing the make command. For instance, if the major Vim version is at 8.2, then make line should be:
 <code bash> <code bash>
-make VimRUNTIMEDIR=/​usr/​local/​share/​Vim/Vim82 -j8+make vimRUNTIMEDIR=/​usr/​local/​share/​vim/vim82 -j8
 </​code>​ </​code>​
  
 Then grab the Vundle plugin manager. Then grab the Vundle plugin manager.
 <code bash> <code bash>
-git clone https://​github.com/​VundleVim/Vundle.Vim.git ~/.Vim/​bundle/​Vundle.Vim+git clone https://​github.com/​Vundlevim/Vundle.vim.git ~/.vim/​bundle/​Vundle.vim
 </​code>​ </​code>​
  
-Get the ''​%%.vimrc%%''​ file from my gitrepo ​[[https://​github.com/​paulsammut/​paul_scripts/​blob/​master/​install/​res/​.vimrc|link]].+Get the ''​%%.vimrc%%''​ file from my git repo [[https://​github.com/​paulsammut/​paul_scripts/​blob/​master/​install/​res/​.vimrc|link]].
  
-Run Vim and use command <​code ​Vim>:​PluginInstall</​code> ​+Run Vim and use command <​code ​vim>:​PluginInstall</​code> ​
  
 YouCompleteMe requires a bit more processing to install: YouCompleteMe requires a bit more processing to install:
    
 <code bash> <code bash>
-cd .Vim/​bundle/​YouCompleteMe ​+cd .vim/​bundle/​YouCompleteMe ​
 ./​install.py --clang-completer ./​install.py --clang-completer
 </​code>​ </​code>​
Line 95: Line 95:
 // List of packages to not update (regexp are supported) // List of packages to not update (regexp are supported)
 Unattended-Upgrade::​Package-Blacklist { Unattended-Upgrade::​Package-Blacklist {
- "Vim";+ "vim";
 //​ "​libc6";​ //​ "​libc6";​
 //​ "​libc6-dev";​ //​ "​libc6-dev";​
Line 107: Line 107:
 [[https://​github.com/​Valloric/​YouCompleteMe/​issues/​2136|link]]. [[https://​github.com/​Valloric/​YouCompleteMe/​issues/​2136|link]].
            
-<​code ​Vim>+<​code ​vim>
 :echo has("​python"​) ​    "​ this tells you if you have python2 support :echo has("​python"​) ​    "​ this tells you if you have python2 support
 :echo has("​python3"​) ​   " this tells you if you have python3 support :echo has("​python3"​) ​   " this tells you if you have python3 support
Line 127: Line 127:
 |script-variable| ​   s:   Local to a |:​source|'​ed Vim script. |script-variable| ​   s:   Local to a |:​source|'​ed Vim script.
 |function-argument| ​ a:   Function argument (only inside a function). |function-argument| ​ a:   Function argument (only inside a function).
-|Vim-variable| ​      ​v:​  ​ Global, predefined by Vim.+|vim-variable| ​      ​v:​  ​ Global, predefined by Vim.
 </​code>​ </​code>​
  
 The following command shows you all the variables that are set. The following command shows you all the variables that are set.
-<​code ​Vim>+<​code ​vim>
 :let g: :let g:
 </​code>​ </​code>​
  
 If you type a variable name after, you will get what it is currently set to.  If you type a variable name after, you will get what it is currently set to. 
-<​code ​Vim>+<​code ​vim>
 :let g:​CommandTTraverseSCM :let g:​CommandTTraverseSCM
 </​code>​ </​code>​
Line 150: Line 150:
 The following is info on the plugins I use. The following is info on the plugins I use.
  
 +==== Airline ====
 +
 +It took me so long to figure this stupid plugin out. It doesn'​t work out of the box. You need to dig through all kinds of documentation.
 +
 +=== For MacOS ===
 +
 +Install the patched font, then select the font in terminal.
 +
 +{{:​screen_shot_2019-12-26_at_9.45.42_pm.png?​400|}}
 ==== NerdTree ==== ==== NerdTree ====
  
Line 163: Line 172:
 the ''​%%.vimrc%%''​ file: the ''​%%.vimrc%%''​ file:
  
-<​code ​Vim+<​code ​vim
-let g:​ycm_global_ycm_extra_conf = '~/.Vim/​.ycm_extra_conf.py'​+let g:​ycm_global_ycm_extra_conf = '~/.vim/​.ycm_extra_conf.py'​
 </​code>​ </​code>​
  
Line 179: Line 188:
 red, and they cover any text making it super annoying. SO. You have to change the red, and they cover any text making it super annoying. SO. You have to change the
 color. THIS IS NOT EASY as there are like a bajillion different colors. There are color. THIS IS NOT EASY as there are like a bajillion different colors. There are
-cterm colors and gui colors. Gui colors are for gVim, which we don't use so don't+cterm colors and gui colors. Gui colors are for gvim, which we don't use so don't
 worry about that. We use cterm colors, and there are ctermfg and ctermbg. ​ worry about that. We use cterm colors, and there are ctermfg and ctermbg. ​
  
 <​code>​ <​code>​
-gui == gVim.+gui == gvim.
 cterm == terminal. cterm == terminal.
 fg == foreground fg == foreground
Line 202: Line 211:
 So to change the warning highlight color, I would say:  So to change the warning highlight color, I would say: 
  
-<​code ​Vim>+<​code ​vim>
 highlight YcmWarningSection ctermfg=XTERMCOLORNUMBER highlight YcmWarningSection ctermfg=XTERMCOLORNUMBER
 </​code>​ </​code>​
Line 210: Line 219:
 ==== Command-T ==== ==== Command-T ====
 For the command-t plugin, you need to go to ''​%%~/​.vim/​bundle/​command-t%%''​ and For the command-t plugin, you need to go to ''​%%~/​.vim/​bundle/​command-t%%''​ and
-type in ''​%%rake make%%''​. This is to fix the command-t "Vim could not load the+type in ''​%%rake make%%''​. This is to fix the command-t "vim could not load the
 c extension"​ error. c extension"​ error.
  
Line 233: Line 242:
 brackets. There are lots of ones I use regularly and to refresh do  brackets. There are lots of ones I use regularly and to refresh do 
  
-<​code ​Vim>+<​code ​vim>
 :help unimpared :help unimpared
 </​code>​ </​code>​
Line 244: Line 253:
  
  
-===== Vim Operations =====+===== vim Operations =====
  
 ==== Exuberant Ctags ==== ==== Exuberant Ctags ====
Line 267: Line 276:
 To search and replace within a visual selection within a line you must use the %V atom. Make a selection and use the following command: To search and replace within a visual selection within a line you must use the %V atom. Make a selection and use the following command:
  
-<​code ​Vim>+<​code ​vim>
 :​%s/​\%Vselection/​replace/​g :​%s/​\%Vselection/​replace/​g
 </​code>​ </​code>​
Line 273: Line 282:
 ==== Movement ==== ==== Movement ====
  
-<​code ​Vim>+<​code ​vim>
 ]]  " Jump forward to begin of next toplevel ]]  " Jump forward to begin of next toplevel
 [[  " Jump backwards to begin of current toplevel (if already there, previous toplevel) [[  " Jump backwards to begin of current toplevel (if already there, previous toplevel)
Line 287: Line 296:
 ==== Commenting ==== ==== Commenting ====
  
-I use plugin [[https://​github.com/​tomtom/​tcomment_Vim|tcomment]] for commenting lines. Keybindings are:+I use plugin [[https://​github.com/​tomtom/​tcomment_vim|tcomment]] for commenting lines. Keybindings are:
  
-<​code ​Vim>+<​code ​vim>
 gc{motion} ​         " Toggle comments ​ gc{motion} ​         " Toggle comments ​
 gc<​Count>​c{motion} ​ " Toggle comment with count argument ​                   gc<​Count>​c{motion} ​ " Toggle comment with count argument ​                  
Line 297: Line 306:
  
 ==== Programming ==== ==== Programming ====
-<​code ​Vim>+<​code ​vim>
 <​leader>​ r          " Toggle true/false <​leader>​ r          " Toggle true/false
 </​code>​ </​code>​
Line 309: Line 318:
 ==== Vidir ==== ==== Vidir ====
  
-To edit filenames in a dir using Vim, use the linux executable ''​%%vidir%%''​ from the ''​%%moreutils%%''​ package. Changes take effect after exiting.+To edit filenames in a directory ​using Vim, use the linux executable ''​%%vidir%%''​ from the ''​%%moreutils%%''​ package. Changes take effect after exiting.
 ===== Programming C/C++ in Vim ===== ===== Programming C/C++ in Vim =====
  
Line 335: Line 344:
  
 Link: [[https://​github.com/​christoomey/​dotfiles/​issues/​13|Problem]] Link: [[https://​github.com/​christoomey/​dotfiles/​issues/​13|Problem]]
-Link: [[http://useVim.com/​2012/​04/​18/​startuptime/​|Helpful]]+Link: [[http://usevim.com/​2012/​04/​18/​startuptime/​|Helpful]]
  
 Issue is because of xsmp init. Vim is trying to connect Issue is because of xsmp init. Vim is trying to connect
- 
  
  
  • vim.1561745662.txt.gz
  • Last modified: 2019/06/28 18:14
  • by paul