vim

in Vim how do I hide the eol doc chars ^M

in gvim on windows if I have text with CRLF eol then the text will display ^M at the end of each line. How do I 'hide' that special char from display? the :set nolist command """ does not dismiss it. I am stumped. UPDATE I did :set fileformats=unix,dos as a list but it didn't work at first. I closed the file and reopened it agai...

Proper XML formatting when viewing log file contents.

I am trying to read some logs through a Linux terminal which contain some XML, (the entire log is not XML, but some of it's contents is). Is there any text editors, add-ons or scripts which will attempt to format the the contents that is XML to make it easier to read. I dont need it to save the new formatting, just display it for easy ...

reference a filename in vi

Sometimes I run make directly from the vim command line. However, sometimes I would just like to build one file currently being edited: !g++ filename.cpp . Is there a shortcut to reference the file without having to type it..? Guys, I DO NOT want to use make at all. all I want to do is to build it from vi's command line, using g++/gcc ...

Vim Ctrl-Left/Ctrl-Right keys behaviour

Is it possible to specify the symbols where cursor will stop after pressing Ctrl-Left/Ctrl-Right keys in VIM? Is it possible to make it's behaviour like in windows? Cursor jumps too far when using these combinations. Also, 'b'/'e' keys help a bit but they make cursor to jump to shorter distance. Thanks. ...

how to move to the next enclosing brackets in VI

Are there any shortcuts to move to the next enclosing brackets. For ex: int func() { if(true) {//this point for(int i=0;i<10;i++) {//need to jump from here to //blah blah blah } } } I can move to the beginning of a function using [[ but not sure how to move to the next enclosing brackets. Thanks for any info... ...

Highlighting #defined value in VIM

Hi all, I have XYZ highlighted in the header file where I have defined XYZ. However at the point of where it is used, XYZ is not highlighted. How would I fix this ? I have attached two screen shots (see TH_SYN in the code) to clarify my question- link text Any pointers are welcome. Many thanks. ...

how can I make vim send command to gnu screen session

I am trying to figure out how to script vim to send a message to a gnu screen "window". i.e. I have a screen session open and in one window I have a vim session and in the other a scheme interpreter. When I save my vim session I would like it to restart the interpreter in the other window loading in the new environment. I can figure out ...

Vim textwidth comma indent problem

If i set the following option in Vim, set textwidth=80 the text will break at 80 characters. This works, but the problem is if a comma (,) is on the end of a line, Vim indents the next line. What can I do to avoid this behaviour? ...

Coming from a Visual Studio background, what do you recommend I use to start my VERY FIRST Python project?

Hi there guys, I'm locked in using C# and I don't like it one bit. I have to start branching out to better myself as a professional and as a person, so I've decided to start making things in my own time using Python. The problem is, I've basically programmed only in C#. What IDE should I use to make programs using Python? My goal is to...

vim and unrecognized characters

I have a file with some accents, and VIM displays them as "~V" characters. The "od -bc" command tells me the characters are charcode 226. I want to substitute them using VIM. But I can't get it to match the characters. How can I achieve that? Optional question: how can I have VIM tell me which charset is used to interpret the current fi...

emacs equivalent of vim's shift-h and shift-l

i'm wondering if emacs has these cursor movement commands built in or if i'm going to have to write them or find a snippet somewhere. i find them pretty spiffy and use them in vim regularly. i haven't found them in emacs' documentation so far. in vim, they look like this: shift-h -> move cursor to the top of the screen shift-m -> move c...

Getting proper code completion for Python on Vim?

I've gotten omnicompletion with Pysmell to work before, but I can't seem to do it again. I tried following some steps online, but most, if not all, of them are to vague and assume too much that you know what you are doing to some extent. Can someone post a full, step-by-step tutorial on how to get code completion working properly, for...

vim how to open files in vertically/horizontal split windows

there must be vim -[option] file-list to open files in FROM COMMAND PROMPT and NOT from within VIM split widows vertically or/and harizontally in separate tabs assume I am using vim 7.2 ...

How can I execute a command when a buffer is closed in vim?

Is there something like a close-window-hook in vim/vimscript, so that I can call a function every time a window is closed? I want to use it for the following scenario: I use an extra scratch window to display information about the file, and when I close the file I want the scratch window to be closed automatically so that vim exits. If...

.vimrc configuration for Python

My current .vimrc configuration is below: set nohlsearch set ai set bg=dark set showmatch highlight SpecialKey ctermfg=DarkGray set listchars=tab:>-,trail:~ set list autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class set tabstop=4 set shiftwidth=4 set expandtab set autoindent set smartinden...

The behavior of ; to repeat the last t command bothers me. Can you help me make it better?

Okay, suppose we have a line of text: [s]tackoverflow rocks where the brackets show the location of the cursor, in normal mode. After pressing tr, you get: stackov[e]rflow rocks Now for the fun part. What happens if you push ; to repeat the command? Nothing! Vim finds the next 'r' (immediately to the right of the cursor) and positi...

Fix Home and End

I'm using vim in gnome-terminal (2.26.0): although I use 95% of the time "$" to navigate to the EOL and "0" for the opposite, every now and then I hit "Home" or "End". When I use Home, the text I have in the current line is moved on line down, leaving me in insert mode in the current line and the letter H appears at the beginning of the...

vim left and right column highlight

I need to highlight anything beyond column 72 with a different background color. What's the best method? Something similar to a visible line margin that some editors do is also good. Is it possible? Some background: The syntax is a Pascal like, and works correctly. Only the Background needs to change. The foreground is already hig...

VIM: how to put result of a colon command into a variable?

Hello. In VIM script, i want to check if VIM was started with command-line arguments or wthout. For this, i want to check a result of :args command that prints arguments. But how to put a result of :args inside an if() or a variable. Following wll not work: let s:MyArgs = execute( "args" ) ...

Define colored keywords working with all syntax-files

What I want is to define a list of approx. 20 keywords which will be same coloured independet from the active syntax-file. I copied and and pasted the following to my .vimrc to highlight the word DONE, but it won't work. syn match tododone /DONE/ syn region done start=/\*\*DONE/ end=/\*\*/ hi link tododone tDone hi link done tD...