New answers tagged

0

These files were annoying for me too, but i set option in .vimrc - set noswapfile to prevent vim create it and, instead, keeping files in memory.


0

I've forked a new plugin SimpleAutoComplPop from the original AutoComplPop. Though, I'm not familiar with ruby or snipMate, you may have a try and I'm glad to get some feedbacks :)


0

Vim comes with a Perl indent plugin, and as long as you have :filetype indent on somewhere in your startup (such as your vimrc) it should be able to do indenting of Perl files for you. But note that it will only do indenting, it won't add or remove newlines.


1

You can. Try this: :command! -nargs=+ Doit :w | :exe "!" . <q-args> . " %" | :e Or if you just want to "hard code" the command: :command! Doit :w | :exe "!something %" | :e Note that user-defined Vim commands must always start with an uppercase letter. For reference: :help :command :help <q-args> :help :execute :help :|


0

This is what worked for me set autoread au CursorHold * checktime The first line wasn't enough by itself. You can put in you .vimrc credit to Phan Hai Quang


0

There are plugin managers for Vim that do this For your example in vim-plug. Plug 'davidhalter/jedi-vim', {'for': 'python'} where the string is the author/name of the github repository. All scripts from vim.org are also rehosted on github via vim-scritps.org under the user vim-scripts


4

Because visudo is using vi as a default editor.


0

For those more comfortable with Visual mode: 1. Identify the line number above the selection you want flipped using :set nu. 2. Shift-V to highlight selection you want flipped (visual mode). 3. :g/^/m <Line number from step 1>. Note that in visual mode it will automatically show up as :'<,'>g/^/m <Line number> when you type in the ...


0

in vim, type :scriptnames. :scr[iptnames] -- List all sourced script names, in the order they were first sourced. The number is used for the script ID.


1

The easiest way I found was to add the file I needed to the system vim file that MacVim created on installation. This file can be found using :scriptnames command. I needed to use pathogen and it was not working placing it in my .vim file in the home directory. I placed the pathogen.vim in the system vim/autoload directory and then pathogen worked without ...


0

The @ in the output means the mapping is buffer local, and you have to unmap it as buffer local: :unmap <buffer> [[ See: :help :map-local :help map-listing


0

A slightly better solution, then pinnin vim would be updating your syntastic. See https://github.com/scrooloose/syntastic/issues/1738 The issue has been fixed in https://github.com/scrooloose/syntastic/commit/d9814c5233931bb111fcae7cdc623a9f29495e5d


0

You can try this. :map <End> $a<space><ESC> This will move to the last character, then appends a space and then moves to it.


0

You need to run an expression that checks to see if the line has characters, and acts accordingly. Try this: :noremap <expr> <end> (col('$')>1?"\<lt>end>\<lt>right>":'') See: :help :map-<expr>


1

I set the numberwidth to, say, 5 and then set the columns to 85 (80+5) That should be good for files from 0 lines to a million lines. Here is what you may have to put in (default) ~/.vimrc file set numberwidth=5 "Good for files upto a million lines set columns=85 set nu You will see line number are formatted with '%5d' (5 is the numberwidth above) ...


4

Efficient answer Press f"d^f"lD to keep the current object in the current line, deleting rest of them. f" - find " d^ - delete from current cursor position to start of line. l - move right D - delete from current cursor till end.(d$) You can create a text object too! :nmap de" f"d^f"lD // de" - delete except double ...


0

edit is still available in Windows 7. Microsoft removed it in Windows 8 and up. If you want to create a simple file from the command prompt use: c:> copy con filename.txt Use CTRL+Z to save the file. You can also use echo and pipe it to a file.


0

I suspect this is a buffer-local mapping set up by a system-wide ftplugin. You can check for buffer-local mappings, and show which script set them, by running this command while in the buffer in question: :verbose imap <buffer> You can also check what scripts have loaded, including filetype plugins, with this command: :scriptnames


0

We use bdel to unload a buffer from buffer list. You can give :bdel % to unload current buffer. To unload alternate buffer, you can give :bdel # For unloading other buffers, you can enter their numbers like :bdel 1. (By giving :buffers, you will get all the buffers, you can check the number of each buffer) To completely delete a buffer and its ...


0

Yes! You can use a colorscheme for vim different than terminal. Vim allows using different types of colorschemes. You can change them at any time. You can use different colorschemes for different filetypes also! Refer http://stackoverflow.com/questions/7331940/how-to-get-the-list-of-all-installed-color-schemes-in-vim for some basics about colorscheme. You ...


2

You actually want to stop visual mode when moved cursor using mouse. I think your plugins might have changed the mouse mode to a. :set mouse=a //This causes visual mode. Change it to :set mouse=r in command line. Or, put this line in your ~/.vimrc. If that doesn't work, then you can put :au BufEnter *.* :set mouse=r in ~/....



Top 50 recent answers are included