All Questions

Filter by
Sorted by
Tagged with
10
votes
3answers
14k views

Is there a difference between “sudo apt-get vim” and “./configure --with-features=huge”?

I'd like to install VIM via apt-get, but I'm not sure if I get all of its features. Is there a difference between this, and compiling it from source?
0
votes
2answers
294 views

Adding leading and trailing space when entering insert mode

I use vim with ruby. I have a habit of opening and closing brackets when I define new function or a block. For example I would type: array.map {}_ # _ - cursor position after finishing typing So I ...
3
votes
1answer
122 views

Error, polytonic Greek spell file

Is anyone using the polytonic Greek spell file successfully? I get Error detected while processing /Users/lawrence/.vim/spell/polytonic.utf-8.spl: E763: Word characters differ between spell files. PS....
2
votes
1answer
129 views

Custom motion to change, delete or select matching pattern

I'm looking how I might use "Operator-Pending" mode to make a custom motion that allows change, delete or visual selection of a pattern match under the current cursor position. In short, after ...
2
votes
1answer
162 views

How to get uniform tabs/spaces in other programs (like Less)

How does one get uniform tabs/spaces to display properly in other programs (like Less)? For example, say I am modifying my .vimrc in Vim and I've created two columns on the same line (one for rule ...
1
vote
1answer
278 views

How to pass a parameter to JSHint with Syntastic

I need to pass a paramter (-extract) to the jshint syntax checker such that it extracts JavaScript from HTML before checking. Unfortunatly I have no idea how to do that for syntastic.
3
votes
1answer
466 views

Syntax concealends not applied

I am developing a syntax file and I am struggling with a concealends property : syntax region Reference start="{reference}" end="{/reference}" conceal syntax region Name start="{name}" end="{/name}" ...
7
votes
1answer
10k views

How to enter tilde (~), back tick (`) and special chars with a non-US keyboard?

I usually use Vim with an Italian keyboard (I'm from Italy), (mainly in an Ubuntu Linux Virtualbox guest from a Windows host). I have problems when I have to enter some frequently used characters (...
2
votes
0answers
73 views

Dividing long paragraphs across pages

By default, vim will not split long paragraphs (or any paragraphs (= long lines)) across pages. Instead of showing the first part of a paragraph that does not fit into the page entirely, it leaves out ...
1
vote
1answer
46 views

How to use vim editing abilities while asking question on MSE

I have a pretty huge .vimrc by now which use to edit tex documents. I also ask questions on MathStackExchange frequently and there I do not have any of the keybindings which I have when I am working ...
3
votes
3answers
1k views

How to show all unsaved files opened in vim?

I'm not sure if I should ask this problem on vim or on Linux/Ubuntu forum. The thing is, I opened multiple terminals on my desktop, and several of them opened various of *.txt files. Not all of them ...
2
votes
2answers
483 views

How to execute a mapping on <F7> key from a script?

I have the following mapping in my project: nnoremap <F7> :execute '!gtags'<cr> :cscope kill -1<cr> :cscope add CTAGS<cr> Under certain conditions I want to be able to ...
10
votes
6answers
2k views

How to append some line at the end of the file only if it's not there yet?

I'd like to edit a file in-place by appending a line, only if doesn't exist yet to make my script bullet-proof. Normally I'd do something like: cat >> ~/.bashrc <<EOF export PATH=~/....
2
votes
1answer
173 views

vim-latex/latex-suite: command sequences not coloured

Some command sequences consisting of \ and a non-letter (,, 2) are not coloured (\& is). How to fix?
3
votes
3answers
114 views

Turn off highlights when pattern is entered

I find :set hlsearch useful while I am entering the pattern; but I want the effect of :noh as soon as I press enter. Is that possible?
2
votes
1answer
383 views

Why is make running against a wrong file?

I am trying to get VIM to run the right makefile for a specific source file. For example, if the current file is ui8_c_buff_test.cpp and if I use the makeprg configuration below and run make, let &...
3
votes
0answers
1k views

How can I undo last command in command line?

In general, is there a way to UNDO the last "meta" command (I mean a command entered in command line to manage a window ), or some equivalent keystroke sequence ? Btw, I know the u (= undo) and CTRL-...
3
votes
2answers
16k views

How to match the first occurence of a repeating pattern on the same line?

I'd like to replace the following code: ThisIsALoooongNameOfATwoDArray[100-rowIndex][j-2]-ThisIsALoooongNameOfATwoDArray[100+rowIndex][j+2]; by Ptr[j-2]-Ptr[j+2]; I tried the command :%s/This.*ex\]...
7
votes
2answers
3k views

GNU global and vim

Has anyone used GNU global with vim? I'm navigating through a large C++ code base and have some trouble figuring out how to use it. I want to use its gtags-cscope functionality but I can't figure out ...
2
votes
1answer
674 views

How can I detect whether an unlisted buffer contains a new file or an existing file?

Upon opening a new file in an active buffer in the current window, the message line at the very bottom of the screen shows "%f" [New File]. How does Vim know that the buffer contains a new file, ...
4
votes
2answers
637 views

How to add a uid to html nodes?

I have a giant html file which is a mess (not my fault). I want to add to some nodes (about 400) a unique id. They all have are of the same class, so I can add the id like this :% s/class="some-class"...
4
votes
1answer
2k views

What is a better way to use `windo` without changing of window?

In my vimscripts I sometimes have to use the windo command to execute an action on each open split. The problem with this command is that it cycles through all the open splits and ends on a different ...
8
votes
1answer
296 views

Is it possible to use '/' search as an inclusive motion (similar to what 'f' is to 't')?

I've been a long time fan of the t and f motions to modify text up to or including some character. For more complicated criteria, I've started using / followed by a search string to modify text up to ...
1
vote
1answer
142 views

Wrapper script for vim --remote

I need to set on my Linux box VIM as default mime application for editing text file. On zsh I managed to wrap a function from vim --remote. But I would like to use it for default xdg-mime application ...
4
votes
2answers
207 views

How do I remove lines where its content already occured in the previous line?

For example I've the following text: This is my first line, but longer. This is my first line This is my second line, but longer. This is my second line This is my third line, but longer. This is my ...
6
votes
7answers
843 views

Is there a vim command line option to edit last edited file?

Is there a way to run vim from command line to edit the last edited file? Let say I first edit file giorgio.sh: $ vi giorgio.sh Afterwards, I exit back to terminal $ do something... $ do something ...
2
votes
1answer
381 views

uneven quickfix window output from Ack/Ag

For some reason I get, what I call an "uneven" output from Ack/Ag in the quickfix list window. My project directory structure is the following: /home/user/projects/myproject | ---- llvm-or1k | -...
5
votes
1answer
117 views

Edit comments as if separate lines?

Is there a way to edit comments so that they will all be aligned without having to align them manually with tab? i.e., How can I get something like that? some text %comment some more text ...
4
votes
2answers
251 views

Can one jump in ex mode?

Say I entered :e bla/bla/bla.txt and I realize I want to put a ! after the e. Can I get there without using the arrow keys?
2
votes
1answer
113 views

Insert mode completion of executables in `$PATH` (like `compgen -c`)

When writing shell scripts, it is frequently necessary to call external commands in $PATH. Some of these have long names (e.g. system-config-printer-applet or xfwm4-workspace-settings), and it would ...
1
vote
1answer
413 views

Why is :w command so slow for a relatively small file? [closed]

I have a file with 30000 lines (3MB), when I use :w vim editor hangs for several seconds, but when I use pure vim/vi it takes only a moment to save the changes. Why do I get this effect? What could ...
4
votes
1answer
794 views

How can I clearly document errorformat patterns in a plugin compiler file?

While testing out the vim-go plugin I encountered an issue that I wanted to look into more closely. In a comment on the issue, the owner of the plugin writes: The text read 0 byte, err read tcp 127....
1
vote
1answer
83 views

Output of shell commands is going beyond available screen space

When Im writing shell scripts I often want to run/check a block of code, by V highlight block then :'<,'>w !bash vim will then execute highlighted block and display output at the bottom of ...
7
votes
1answer
4k views

find next occurrence of word or line at cursor

For example when editing a big .gitignore file and pasting in a block for a newly added toolset's suggested ignore patterns, I manually looked at each line and typed /\.filetype where filetype is what'...
8
votes
1answer
632 views

Automatically breaking lines in comments?

Vim has the excellent command set tw=79 which will automatically break your lines at 79 characters, however I like (just) my comments broken at 72 characters automatically. Is there any good way to ...
0
votes
1answer
594 views

Tab keep triggering jump backward in ultisnips

I have a problem with UltiSnips. It keeps jump backwards even tough I didn't map it in my .vimrc file. My .vimrc look like this let g:UltiSnipsExpandTrigger="<C-l>" ...
0
votes
2answers
78 views

How can I soft wrap the gundo preview?

As the title. Basically I want to apply set linebreak to the gundo window.
2
votes
0answers
49 views

Vim slowdown when browsing with netrw [duplicate]

Sometimes there are several second long slowdowns when browsing Clojure source code in a Git repo via Vim's netrw. My Vim version is 7.4.865. I do have a couple of plugins that must have caused this. ...
4
votes
1answer
825 views

Can vim make use of the meta key?

Is the meta key supposed to do anything in vim? It would be nice if the things that can be done on the command line could also be done in insert mode (such as <M-t> for transposing words). As it ...
5
votes
1answer
593 views

How can I get vim-surround to automatically indent surrounded HTML code?

I am wanting to wrap the <h2> and the <div> blocks below and surround them both with another <div> <body> <h2>Im a heading</h2> <div class="row"> ...
4
votes
0answers
165 views

How to utilize the Cygwin ack tool from Vim 7.4?

I used Cygwin perl and cpan to download, compile and test a working ack, struggling with a clean working model. Primarily using win32 Vim, it seems like I can only utilize the Cygwin ack if I change ...
7
votes
3answers
159 views

Reusing search pattern in ex mode

Sometimes I want to try a pattern with / before doing :%s/ …; can I reuse it without having to type it all over? (or use the mouse.)
6
votes
2answers
677 views

How to paste a line in a vertical selection block?

Consider the following text: long foobar=(test); int barbar=(something); char foofoo=(); Suppose I have yanked some chunk of code which I want to place before each opening parenthesis, e.g. ...
8
votes
2answers
651 views

Move after end of word or Delete after cusor

What is the fastest sequence to delete to the end of line after the cursor position? Example: I want to delete this line in a faster way Sequence: 5eD will delete the last character of the word ...
1
vote
2answers
98 views

How to create a mapping to replace all non word characters at the beginning of a line?

I'd like to quickly replace all non word characters up to first word \w character with a space. ----So that this line becomes So that this line becomes ----------------And this line looks like ...
2
votes
1answer
2k views

vim indentation setup - Ruby [closed]

I have a problem with indentation using vim. Lets say I have a file: class My end // <-- cursor is here When I press O vim will create new line in between class and end and it will be indented. ...
7
votes
1answer
2k views

How do I get back to the previous line after moving?

I am new to Vim. My code file has 300 lines. Suppose currently the cursor is on line 254, and I used gg command the cursor turn to line 1. I want to go back to line 254 but I forget that line number. ...
1
vote
0answers
89 views

Strange behaviour when editing c and cpp files after update [closed]

After updating vim, it behaves very irrationally when I try to edit a c or cpp file. Here is a picture: I have tried to debug a bit, and both vim -u NORC -N --cmd 'call pathogen#infect()' file.c ...
20
votes
4answers
3k views

What is the most convenient way to work with different keyboards in vim?

I sometimes need to write Greek words, but when I am using the Greek keyboard, hitting, say, <C-p> will be understood as <C-π> and not as the command I intend. This can be fixed with :map &...
11
votes
3answers
2k views

Is it possible to create mappings with parameters?

I have created a few mappings like so: :nnoremap <buffer> <leader>xyzABC :call SomeFunc('ABC')<CR> :nnoremap <buffer> <leader>xyzDE :call SomeFunc('DE')<CR> :...

15 30 50 per page
1
153 154
155
156 157
180