vim

Vim path seperator & auto-completion

Working on web stuff, in windows, to be hosted on linux. Completing paths with ^X^F automatically inserts "\" as the path separator on windows, which is quite correct, but not what I want, so: Is there a way I can tell it to use "/" as the path separator for auto-completion regardless of OS? ...

Vim: add paste buffer every time certain text is found

In Vim I am trying to paste a few lines: PROC SQL; CONNECT TO DB2(DSN=test); CREATE TABLE test AS SELECT * FROM CONNECTION TO DB2 ( above every line starting with "select" and ); quit; below every line that ends with "FOR FETCH ONLY" Is there a way to use the paste buffer? Like %s/^select/(a!)\rselect/ so that it once...

How to block (column?) paste in vim

how can i paste something on multiple lines? i'm trying to achieve the same as: In an existing text, I can <C-v>jjjjj<S-I>HelloWorld<CR> to have HelloWorld inserted in 5-rows but instead of typing HelloWorld I'd like to get the text from a register. i want to first yank HelloWorld then insert it in 5 lines. ...

How to replace line-endings in VIM

How can I replace all line-endings in big file (>100MB)? I have tried to do :%s/\n/, /g but it's too slow. ...

vi input mode in command line Matlab?

I have these lines in my ~/.inputrc: set editing-mode vi set keymap vi This allows me to use vi keybindings in every program that uses GNU readlines for text input. Examples: python, irb, sftp, bash, sqlite3, and so on. It makes working with a command line a breeze. Matlab doesn't use readlines, but vi keybindings would be amazing...

Making JavaSciptLint more configurable

I am using mvim with plugin JavaScriptLint. It works great. However sometimes I work on jQuery or other JavaScript libraries and every single time I save the file, I get tons of warning and cursor moves to the very first warning. What I would like to have is some way to turn this feature On or off. Something like :set enableJavaScript...

Autocommands for Matlab in vim?

I use several different programming languages every day, and I'd like to have different tab widths (in spaces) for each. For example: I use the "standard" 2 spaces for Ruby, but all our existing Matlab code uses 4 spaces. I have this from my personal ~/.vimrc: augroup lang_perl au! set tabstop=4 " tabstop length N in spaces ...

how to copy a consecutive set of none empty characters in vim

${BASE}/test/ other_consecutive_none_empty_characters If the cursor is under the $ sign ,how can I copy "${BASE}/test/" as a whole and paste it somewhere else in vim ? I don't want to use the human-eye-letters-counting solution if that is the only solution I'd rather like to hit the keyboard charcter by charcter . ...

How to display variables in Taglist window in vim

I am using Taglist plugin in vim. In the taglist window i can see tags like namespaces, classes, struct, function but not variables. I saw a screenshot(attached below) on Taglist website which had this info. I am using Vim 7 and Exuberant Ctags 5.8, and i have generated my ctags using this command ctags --c++-kinds=+p --fields=+iaS --e...

Configure Macvim's text selection to not include character under cursor

Using macvim, when I copy a text selection, it always includes the character under the cursor. For example, if the cursor is at the far left and I press shift-down arrow, it selects the entire line plus the first character of the next line (since the cursor is sitting over the next line's first character). Is there a way to configure m...

Vim: sort classes in a python source file

I have a .py file with lots of classes: class First(Second): #code class Third(Fourth): #code Is it possible to sort the definitions by class name in vim? ...

vim restores cursor position; exclude special files

The following code is inside my .vimrc and generally restores the last cursor position of a file I opened with vim: autocmd BufReadPost * \ if line("'\"") > 1 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif I really like this feature and want to leave it turned on, except for one file: When commiting with git, vim...

Any good Emacs intro videos?

I was wondering if anyone knew of any good Emacs videos. I've found a few Vi ones like: http://vimeo.com/6999927 [~25min overview] http://www.youtube.com/watch?v=71YTkxUNwmg [~11min introduction] http://www.derekwyatt.org/vim/vim-tutorial-videos/ [Tutorial series] And hoped that I might find something similar for Emacs so I could ...

How I can refactor imap nmap vmap code in vim?

I can such code in my .vimrc file: imap <D-1> <ESC>1gt vmap <D-1> 1gt nmap <D-1> 1gt imap <D-2> <ESC>2gt vmap <D-2> 2gt nmap <D-2> 2gt imap <D-3> <ESC>3gt vmap <D-3> 3gt nmap <D-3> 3gt imap <D-4> <ESC>4gt vmap <D-4> 4gt nmap <D-4> 4gt imap <D-5> <ESC>5gt vmap <D-5> 5gt nmap <D-5> 5gt imap <D-6> <ESC>6gt vmap <D-6> 6gt nmap <D-6> 6g...

Python: getting \\u00bd correctly in editor

Hi everyone I would like to do the following: 1) Serialize my class 2) Also manually edit the serialization dump file to remove certain objects of my class which I find unnecessary. I am currently using python with simplejson. As you know, simplejson converts all characters to unicde. As a result, when I dump a particular object with s...

Is it possible to apply vim configurations without restarting?

I want to edit .vimrc file from Vim and apply them without restarting Vim. Is that possible? Thank you. ...

move vim cursor after a function

I'm using both the supertab and snipmate plugins. Let's say I'm using snipmate to create an if statement structure. Once I'm done adding statements inside the if-statement, how can I quickly move the cursor after the if-statement. For example: if [ $a = "b" ]; then bla; fi If my cursor is right on the semicolon and I'm in insert mod...

Get colors using Mac OS X terminal when editing source code in remote linux machines

Hi, I use terminal from Mac OS X Leopard to connect to remote Linux machines and edit C++ code there using VI. What determines that in some machines, using the same MACOSX terminal settings, the source code gets colorized and in other not? Thanks ...

In VIM, how can I have a permenant status line showing me the name of the current file I'm editing?

I keep on forgetting which file I'm editing. In Vim 7.x, how can I have a permenant status bar at the bototm (like what's displayed when I press Ctrl-g) showing the current file name I'm eidintg? Thanks! ...

how to temporarily set makeprg in vim

In the normal case I use vim's make utility I will set makeprg to the Makefile of the project I'm currently working for. Since usually the project will last for weeks or even longer, I don't need to change the setting of makeprg very often . But sometimes I need to write some "foobar" code either for practicing my c++ skill or for proto...