Skip to main content

Home/ VIM Editor/ Group items tagged c

Rss Feed Group items tagged

reckoner reckoner

automatic type along completion as in Notepad++? - vim_use | Google Groups - 0 views

  • augroup foo   au!   au CursorMovedI,InsertEnter * if search('\k\{2,}\%#\k\@!','ncb') |               \ call feedkeys("\<c-n>\<c-p>","t") | endif augroup END inoremap <expr><cr> pumvisible()?"\<c-n>\<c-y> ":"\<cr>" Pressing return-key will accept the first match. Be ready to exit the editor.
reckoner reckoner

matchparen++ - Improvement over standard matchparen plugin : vim online - 0 views

  • mproves over standard matchparen.vim plugin by echoing line containing matching bracket in the status line so you can quickly see which block is terminated by this paren.  Also scans for braces/parens which are off-screen.
  •  
    this is good for brace-based languages like C++
reckoner reckoner

How can I work on VIM for python code such as cscope for C code? - 0 views

  • Change to the top level directory that contains your python source files, and do find -name '*.py' > cscope.files cscope -b
  • How can I work on VIM for python code such as cscope for C code?
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

Tip #227 - Power of :g : for more context - 0 views

  • Display context (5 lines) for all occurences of a pattern     :g/<pattern>/z#.5     :g/<pattern>/z#.5|echo "=========="     << same as first, but with some beautification >> Delete all lines matching a pattern     :g/<pattern>/d Delete all blank lines (just an example for above)     :g/^\s*$/d Double space the file     :g/^/pu =\"\n\"     :g/^/pu _     << the above one also works >> Copy all lines matching a pattern to end of file     :g/<pattern>/t$ Yank all lines matching a pattern to register 'a'     0"ay0:g/<pattern>/y A Increment the number items from current line to end-of-document by one     :.,$g/^\d/exe "normal! \<c-a>" Comment (C) lines containing "DEBUG" statements     g/^\s*DEBUG/exe "norm! I/* \<Esc>A */\<Esc>" A Reverse lookup for records (eg: An address book, with Name on start-of-line and fields after a space)     :g/<patern>?^\w?p               "if only name is interested     :g/<patern>/ka|?^\w?p|'ap       "if name and the lookup-line is interested     :g/<patern>/?^\w?|+,/^[^ ]/-1p  "if entire record is interested Reverse a file (just to show the power of 'g')     :g/^/m0
reckoner reckoner

A Collection of Vim Tips | Ayman Hourieh's Blog - 0 views

  • to auto-indent a piece of code, highlight it in visual mode, and press =. To auto-indent the current line, press ==. Use gq to wrap the highlighted peice of text.
  • SuperTab: Makes all insert-mode completion done with tab. To use, simply press TAB while in edit mode. minibufexpl: Adds a buffer explorer to the top of Vim's window, simplifies working with buffers. taglist: A source code browser that works with many languages, including C/C++, Java, Python, Perl, PHP, ... vcscommand: SVN/CVS integration.
reckoner reckoner

Tip #814 - Use cygwin shell : vim online - 0 views

  • set shell=C:/cygwin/bin/bash set shellcmdflag=--login\ -c set shellxquote=\"
reckoner reckoner

taglist.vim - Source code browser (supports C/C++, java, perl, python, tcl, sql, php, e... - 0 views

  • The "Tag List" plugin is a source code browser plugin for Vim and provides an overview of the structure of source code files and allows you to efficiently browse through source code files for different programming languages.  You can visit the taglist plugin home page for more information
reckoner reckoner

$cdpath on windows xp - 0 views

  • You're welcome. It turns out that it works if you set it like this: set cdpath+=C:/Documents\\\ and\\\ Settings/rpdooling or like this: let &cdpath = ",,,C:/Documents\\ and\\ Settings/rpdooling I don't understand why and I'm trying to find out from the vim mailing list, which is where that solution came from. Regards, Gary
reckoner reckoner

mapping Tab in the command line - vim_use | Google Groups - 0 views

  •     set wildmenu     set wildmode=list:longest,full     set wcm=<C-Z>     map <leader>a :b <C-Z>
reckoner reckoner

cecscope - command and menu driven cscope interface : vim online - 0 views

  • (requires vim7.0aa snapshot #188 or later) DrChip's cscope interface supports commands:     CS     [cdefgist]   : cscope     CSl[!] [cdefgist]   : locallist style (! restores efm)     CSs[!] [cdefgist]   : split window and use cscope     !            split vertically     c (calls)    find functions calling function under cursor     d (called)   find functions called by function under cursor     e (egrep)    egrep search for the word under cursor     f (file)     open the file named under cursor     g (global)   find global definition(s) of word under cursor     i (includes) find files that #include file named under cursor     s (symbol)   find all references to the word under cursor     t (text)     find all instances of the word under cursor
reckoner reckoner

[vim] deleting a pair of matching (), [] or {} - Application Development and Programming - 0 views

  • Assuming you're in normal mode and cursor is on a '('. %x<C-O>x -ap
reckoner reckoner

SourceForge.net: pyclewn - 0 views

  • Pyclewn is a python program that allows the use of the vim editor as a front end to a debugger. Pyclewn currently supports the gdb debugger.
1 - 15 of 15
Showing 20 items per page