All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
57 views

can't find syntax highlighting for offlineimaprc

i can't find any syntax highlighting for offlineimaprc files. Because of vim has normally for everything syntax highlighting (even for esoteric programming languages!), this makes me wondering. Did ...
8
votes
1answer
1k views

Exuberant Ctags - Duplicate tags problem

Here is a file -- ChipBooter.cpp -- in my project(Omit some details that are not related to this question): class ChipBooter { public: void Boot() { this->DpDetect(); } void ...
7
votes
2answers
830 views

How to jump back to the cursor position before I entered insert mode?

I'm trying to set up normal mode mappings to make it easy to add white space around the cursor: <C-h> will add one space to the right of the cursor; <C-j> will add a newline below; <C-...
3
votes
1answer
463 views

Neovim Python script hangs

I'm thinking of migrating from Vim to NeoVim. I decided to begin with a bit of Python code in my .vimrc that sets the backup directory. Using the documentation, I wrote the following script: "-------...
2
votes
0answers
44 views

How do i move all lines from curser and below up one [closed]

Instead of pressing backspace multiple times to move lines up one, is there a vim shortcut/command that can do this? I know you can move a single line up or down with :m - or +, so I figure it there ...
2
votes
0answers
602 views

what is the correct codepage to use with vim airline?

Ok so I have setup my .vimrc as followed but I'm still experiencing a few problems with it: let $VIM=/usr/share/vim/vim74 let $VIMRUNTIME=/usr/share/vim/vim74 execute pathogen#infect() " air-line" ...
6
votes
1answer
93 views

Automatic name for new files

For new files, Sublime Text changes the file name to the first line of the file: Is it possible to achieve this on Vim?
3
votes
0answers
105 views

Strange characters appear after leaving insert mode on Windows

I use Vim v7.4 on a Windows laptop. Recently, I copied my .vimrc from a Mac, only to find that every time I leave insert mode, a sequence of strange characters will appear: These characters (right ...
12
votes
3answers
7k views

Substitute with pure vimscript (without `:s`)

I have the following in my vimrc: func! AddSpaceBeforeEqual() s/\([a-z)_0-9"'\[\]]\)=/\1 =/ge endfunc I'm using vint to lint my vimrc, and got the following warning : ...
4
votes
1answer
434 views

Swap command line and status-line?

Is it possible to swap the order of the command line and status line, such that the status line is flush with the bottom? Or better yet, completely disable the command line - but I understand that ...
2
votes
1answer
873 views

Still force new line at end, but show it too?

Some people prefer not to end a file with a new line. I'm not one of them. In fact, I want to see that it's there! How can I keep this 'force new line at end' behaviour, but show it in the editor? I ...
8
votes
2answers
3k views

Summary of functions in current file?

While working in various source files, (C, Ruby, etc.) I find that I'm often hunting around for functions. Is there a way to have an auto-generated HUD that lists the structure of the current file? It ...
2
votes
1answer
708 views

As an argument of a function, when does a variable name need to be quoted?

If I define the variable foo like this: :let foo = '~/Desktop' And I want to check the length of the string it contains, then I can type: :echo strlen(foo) The output is 9, which is right. If I ...
3
votes
1answer
141 views

Automate running SQL filetype scripts when opening a PHP file

When I open a PHP file in Vim I want Vim to provide SQL assistance as well as all the PHP assistance. From :h sql-completion-filetypes: This can be enabled easily with the following steps (assuming ...
4
votes
0answers
60 views

vipJ unwrapping fails when using custom function

I have decided to use Vim for editing prose, as I find it to be a much more work-conducive, clutter-free environment than most so-called text processors expressly built for that purpose. To that end, ...
5
votes
1answer
400 views

Repeat replace one character (r) for next occurence

I'm using r a lot (e.g. for replacing " with ' when refactoring code). Is there an easy way to do something like this: For text: values = ["a", "b", "c"]. Place cursor on first ", press r' to change ...
3
votes
1answer
106 views

neovim doesn't show expansion “list” of completions

In this example, when class is typed, a list of potential expansions is shown. The snippet itself works in my nvim, but the list is not shown. Commenting out my whole init.vim (the vimrc of neovim), ...
3
votes
1answer
1k views

How to execute a string of conditional commands which includes a shell command?

I currently have the following auto-command (in my vimrc) - autocmd BufEnter *.c nmap <F5> :Makexec<CR> \:if findfile( expand("%:p:r").".exe" ,expand("%:p:h") ) != ""<CR> \ :...
3
votes
1answer
1k views

How to disable key repeat in vim?

I am currently try to break inefficient habits, and one bad habit is to keep a button pressed, e.g. keep pressing j to move down approximately 10 lines instead of moving exactly 10 lines down with 10j,...
22
votes
5answers
9k views

Easiest way to switch git branches

Right now I'm using fugitive to manage almost everything git related, but I can't find a good workflow to quickly visualize and switch between available branches. I can do :Git checkout <branch-...
5
votes
1answer
872 views

Trying to install pathogen, but where?

I make a .vim directory in my home directory. I then made an autoload directory and a bundle directory. I added the pathogen.vim file to the autoload directory. I then added execute pathogen#infect() ...
7
votes
1answer
521 views

Is it possible for Vim to output ANSI colors from the terminal, without a colorscheme?

Many terminal emulators allow you to define colors: Rather than trying to approximate (and duplicate!) the same theme in a Vim colorscheme, is there a way to tell terminal Vim to output ANSI escape ...
12
votes
1answer
985 views

How to use backtick-expansion to populate the arglist?

From help :help backtick-expansion: On Unix and a few other systems you can also use backticks for the file name argument, for example: :next `find . -name ver\\*.c -print` :view `ls -t *....
7
votes
1answer
149 views

Why is the previously inserted text reset after using an arrow key?

From help :help i_ctrl-a: CTRL-A Insert previously inserted text. {not in Vi} Let's say I have an empty buffer and I'm in normal mode. I type i to go in insert mode. I type (), then move the ...
7
votes
1answer
544 views

When is it recommended to use the scope s: and the argument abort to define a function?

When defining a function, is it always recommended to use the scope s: to make it local to the script and avoid overwriting a function with the same name in the global namespace ? And is it always ...
7
votes
2answers
320 views

Why is ] used for tag navigation?

Several of the commands for browsing programs with tags use ]. Is there a mnemonic for this? Why was it selected?
13
votes
2answers
798 views

Is it possible to tell if a window is at bottom or top, left or right?

I don't know if there's some function to check a window's position, I mean is it currently sitting at bottom or top, left or right?? __________________________ | | | | |...
5
votes
4answers
285 views

How to move inside vim's internal pager from a mapping?

I would like to use the normal commands g, and g; more often to navigate through the change list. The problem is I usually don't know how far I am in the change list from the edit I'm interested in ...
9
votes
2answers
1k views

How to start maximized gui with qt-neovim?

I am using neovim with qt-neovim (linux arch). On gvim i could launch a maximized window with: if has("gui_running") set lines 999 columns 999 endif That is not working now tho. I tried removing ...
5
votes
3answers
896 views

How do I open file under cursor, when the filename has a trailing dot?

There is a file with name ./folderA/folderB/file.. And there is text: ./folderA/folderB/file.:abcdefg When I move the cursor on letter B and type <c-w>f, it says E447: Can't find file "./...
1
vote
1answer
832 views

Bracket completion with correct tab and insert placement

I'm looking for a plugin that will autocomplete closing brackets for me. Furthermore, I'd like it to space and tab the inner block automatically. I've tried a number of them where if I'm typing ...
5
votes
1answer
373 views

A plugin to align comments

I often edit code where I have a general comment for a block of code and specific comment for each line. For instance, this a sample of my .vimrc. "indentation set autoindent "...
2
votes
3answers
73 views

How to move to the next matching string and then hit delete twice in a macro?

I have a rather long chat transcript that I copied out of a window, and when I pasted it into vim, it put two line breaks after every username, and then what the user typing said. I'd like to: ...
5
votes
1answer
703 views

Vim auto indentation

I am using Vim with Pathogen, vim-jsx, and vim-javascript. I have trouble getting the correct indentation. When I am breaking one line that is too long into several pieces (without adding new blocks),...
7
votes
1answer
651 views

How to have endless vim history?

According to h: help: Use the 'history' option to set the number of lines that are remembered (default: 20) I know I can set the number of lines higher, yet is there an "endless" option that ...
9
votes
2answers
2k views

Why won't vim source my .vimrc file

Today, I found my .vimrc didn't take effect. It was ok just hours ago. When I launched vim with $vim --plugin, :scriptnames echoed nothing: .vimrc file was not sourced. (Note: /etc/vimrc was removed ...
4
votes
2answers
485 views

Can I make <leader> key modifier, or is there anyway I can get more custom modifier key?

When I define key mappings, I prefer using a modifier key with another key, because modifier key can make you so much fast if you need to press some key mapping multiple times, you only need to hold ...
2
votes
2answers
2k views

Can I open other files without closing the file I'm editing?

I'm new to vi/vim. I learned that I can close a file I'm editing and open the another file at once by typing :vi filename But I sometimes want to open other files without closing the file I'm ...
5
votes
1answer
948 views

How to safely quit vim if there's some unsaved changes?

If I have changed a bunch of files but without saving and maybe I have another pile of noname buffers which are changed and without a file name. I want vim to prompt confirmation for each one of the ...
5
votes
2answers
1k views

Edit Neovim terminal commandline within the same Neovim instance

In bash one can edit the current commandline in $EDITOR by pressing <c-x><c-e>. I am running bash inside a terminal buffer within Neovim. I would like to be able to press <c-x><c-...
4
votes
1answer
975 views

Integration (or emulation) of Vim with NetBeans or Eclipse

Notice: I hope this question fits our site, I'm open to any comments. I've been a Vim user for 15 years now, always as an editor on its own, with some IDE functionalities such as autocompletion among ...
1
vote
0answers
33 views

How to save folds? [duplicate]

I made a few folds in my file, but they were gone after I closed it. I'd like to save them somehow somewhere, and teach vim to automatically load them when I open this file.
5
votes
2answers
484 views

Reformat within comment

In my vimrc I have the following: vmap Q gw nmap Q gwap set formatoptions+=cj set formatoptions-=t This disables automatic text wrapping, and allows me to correctly wrap the paragraph my cursor is ...
4
votes
1answer
216 views

Printing syntax highlighting in ex-mode

If I start vim in Ex-mode, I can have it print the entire file with %print, but it just prints the raw text. Is there a command I can use to get it to print the file with syntax highlighting?
4
votes
1answer
388 views

Is it possible to turn on spell-checking for only parts of buffers?

It seems that spell-checking in vim is normally enabled at a buffer level (set spell vs. set nospell). However, sometimes it would be useful to ignore certain parts of a buffer (for example, URLs in ...
7
votes
3answers
449 views

Is it possible to get the rule (cinoptions) that govern the indentation for a specific line in vim

I have the following code: namespace { template<typename T> struct One // This is the odd line { // impl details } template<typename T> struct Two { // impl details } }...
28
votes
4answers
15k views

How to disable arrow keys in vim?

I want to teach myself using hjkl more than using the arrow keys in order to stay on the home row. And yes, I am very aware that one should not use hjkl as the main navigation keys. Yet my habits are ...
2
votes
0answers
85 views

escaping a character included in a conceal command vimscript

I'm playing with conceal in help files to highlight / colour specific text strings which was working fine until I added the :print: example below. Using this concealed all the : as expected so I ...
3
votes
1answer
568 views

Windows gvim with &shell set to Cygwin bash broken by Windows 10

A recent upgrade appears to have broken the ability of Windows-native gvim (7.4) to run :!-like commands using Cygwin's bash as the shell. (No doubt it's something that's been configured for my ...
4
votes
0answers
119 views

How to align a Latex table that uses \multicolumn?

I want to align a Latex table the way it appears in the final document. There are various Vim plugins for aligning tables (2, 3, 4), but none of them handle the spanning cell correctly. The code ...

15 30 50 per page
1
151 152
153
154 155
187