====== GVim tips and tricks ====== This largely relates to getting GVim set up on the beautiful [[windows|Windows]] operating system. * vimrc file on Wikia: [[http://vim.wikia.com/wiki/Open_vimrc_file]] * Setting the ''.vimrc'' file on windows: [[http://stackoverflow.com/questions/9120500/vim-settings-file-on-windows]] * [[http://stackoverflow.com/questions/10612362/setting-up-gvim-on-windows?rq=1| Setting up GVim on windows]] * NVAlt mode for GVIM - there's a plugin called nvim here [[https://github.com/cwoac/nvim]] * [[http://superuser.com/questions/119991/how-do-i-get-vim-home-directory?rq=| How do I get VIM home directory]] * [[https://blog.interlinked.org/tutorials/vim_tutorial.html| VIM introduction and tutorial]] ====== Navigation ===== Source: [[http://www.cyberciti.biz/faq/howto-switch-between-multiple-files-in-unix-linux-vim-editor/]] ==== Between files ==== Open demo files, enter: $ vi /tmp/foo /tmp/bar OR $ vi /tmp/{foo,bar} To list open files: :ls Sample outputs: 1 %a "/tmp/foo" line 1 2 "/tmp/bar" line 0 To switch to next file: :n OR :bn To switch to previous file: :p OR :bp To open specific file buffer called 10 (use :ls command to list all open file buffers): :b10 You can also switch between all open files, using the following syntax: :b foo OR :b bar Modern text editor such as vim supports enhanced tab completion to get list of open file: :b [HIT-TAB-KEY] To save currently open file: :w ==== Visual editor ==== To split the current window vertically: CTRL+W v To split the current window horizontally: CTRL-W s To switch between vertically open windows i.e. navigate through open windows: CTRL-W h and/or CTRL-W l To switch between horizontally open windows i.e. navigate through open windows: CTRL-W k and/or CTRL-W j Once switched you can load file using any one of syntax as discussed above: :n :b10 :p ===== Templates and scripts ====== * [[http://vim.wikia.com/wiki/Vim_Tips_Wiki:Template_guidelines|Template guidelines]] * ==== Changing fonts in the editor ==== From [[http://stackoverflow.com/questions/20015138/how-to-set-font-to-be-dejavu-sans-mono-in-vim-for-xp?rq=1|Stackoverflow]] In ''$MYVIMRC'', add the line: set guifont=DejaVu\ Sans\ Mono:h11 ...where '':h11'', specifies a height of 11 points. ==== Internal file linking like in the GVim help ==== From [[http://vim.wikia.com/wiki/Keep_a_to-do_memo_file_with_links_as_in_Vim_help]] *memo.txt* My Memo - extending my poor memory |guide| ---------------------------------------------------------------- *subjects* *toc* |cmd| command tips |def| definitions |dev| developments |ed| editors |friends| friends |lang| languages |misc| others |private| personal info |sys| system ---------------------------------------------------------------- Commands *cmd* *General http://www.cslab.vt.edu/manuals ... |doskey| DOS key utility : expand history |man| Unix manual man foo nroff -man foo.1 | less nroff -man foo.1 | a2ps -m |unix| http://gd.tuwien.ac.at/linuxcommand.org/ |winhelp| ... ---------------------------------------------------------------- Development *develop* *dev* ... ---------------------------------------------------------------- vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl: Vim needs to have the following tag file to go to where you want it to go: %userprofile% memo.txt /*%userprofile%* .htaccess meo.txt /*.htaccess* access memo.txt /*access* access.conf memo.txt /*access.conf* addressbook memo.txt /*addressbook* anchor_keyword memo.txt /*anchor_keyword* apache memo.txt /*apache* as index.txt /*as* at index.txt /*at* awk index.txt /*awk* ==== Tags in Vim ==== Turning Vim into an IDE, using Tags as index: [[http://peterodding.com/code/vim/easytags/]] ==== Navigation between files ====