Skip to main content

Home/ VIM Editor/ Group items matching "tutorial" in title, tags, annotations or url

Group items matching
in title, tags, annotations or url

Sort By: Relevance | Date Filter: All | Bookmarks | Topics Simple Middle
reckoner reckoner

VI and VIM editor: Tutorial and advanced features - 0 views

  • Hyper-Linking to include files: Place cursor over the file name (i.e. #include "fileABC.h") Enter the letter combination: gf (go to file) This will load file fileABC.h into vim. Use the following entry in your ~/.vimrc file to define file paths. Change path to something appropriate if necessary. "Recursively set the path of the project.set path=$PWD/**
reckoner reckoner

Vamshi's Vim Notes - 0 views

  • Cursor line and more... * You can turn on cursor line and cursor columns ':set cursorline' ':set cursorcolumn'
  • * Pressing 'q:' or ':<Ctrl-f>' gives the command history window (list of previously executed commands in the current session) * Pressing 'q/' or '/<Ctrl-f>' gives the command history window (list of previously executed commands in the current session)
  • Note: to highlight special keywords we can use the match option as ':hi <MyGroup> ctermbg=red' ':mat <MyGroup> /<pattern>/' To clear these highlights do ':mat[ch]'
  • ...11 more annotations...
  • * '/<pattern1>\|<pattern2>' search for multiple patterns using OR '\|'
  • * Show lines matching word under cursor '[I'
  • Repositioning the Screen 'z' Move current line to top of screen 'z.' Move current line to center of screen 'z-' Move current line to bottom of screen
  • CaSe FOrmaTting "~" swaps the cAse of a single character "g~~" toggles the case of an entire sentence 'guu' or 'Vu' makes an entire sentence lowercase 'gUU' or 'VU' makes an entire sentence UPPERCASE 'vE~' flip case word 'vEU' upper case word 'vEu' lower case word 'ggguG' lower case entire file
  • '=}a' or '=a}' re-indents the current {.....} block relative to how the {, } have been indented General key syntax '=<motion>'
  • Navigating - "[c" will go to the line of the next difference "]c" will go to the line of the previous difference
  • One way to use this is to create a number list insert 1 'qa' 'yy' 'p' 'CTRL-A' on the new line to convert the 1 to a 2 'q' '20@a' and voila! You have number 1 to 22 pasted in your file
  • Three commands can be used to apply commands over multiple files ':argdo' ':windo' ':bufdo' 'argdo' applies a commands on all the files indicated by the 'args' command ':args *.[ch]' ':argdo %s/<pattern1>/<pattern2>/ge | update' The 'e' option suppresses errors if <pattern1> is not found in a
  • You can easily start editing at a previously saved state/views by using the '-S' arguement as 'vim -S session.vim' To create a session at some point, you can use the command ':mks[ession][!] <filename>'
  • :help local-additions' shows you the entries for the local help file
  • The 'set' options can be traced as follows ':verbose set ' - this helps trace from which file this option has been set We can figure out for a particular group what 'autocmd' has been set ':autocmd ' - this shows all that has been set for a particular group & filetype
reckoner reckoner

what are safe key combinations to remap in vim - vim_use | Google Groups - 0 views

  • You can refer to the "Finding unused keys" section in the "Mapping keys in Vim" tutorial available at: http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_tutorial_%28Part_2%29
  • eta keys are almost always safe (<M-A>, <M-B>, etc.). Check for mappings from plugins, etc. before using. When in doubt, use the help. For example, to see if CTRL-J is taken (it is, but there are several commands to do the same thing) type :help CTRL-J and then press CTRL-D instead of ENTER to list all results. Then view each result to see what they do and if there are any alternate ways to do the same thing before mapping. If the mapping is for one mode only, you can prepend the mode. For example, for CTRL-J in insert mode, :help i_CTRL-J
  • Oh, and you can also use the map leader (see :help <Leader>), which defaults to the backslash key. For example, nmap <leader>h :echo "hello world!"<CR>
1 - 7 of 7
Showing 20 items per page