Tag Info

Hot answers tagged

3

Instead of pressing ^ you can press _(underscore) to jump to the first non-whitespace character on the same line the cursor is on. + and - jump to the first non-whitespace character on the next / previous line. (These commands only work in command mode, not in insert mode.)


3

The open command will open the file with the default program, just as if you had double-clicked the file in Finder. However, the command has a few options: -a application Specifies the application to use for opening the file -e Causes the file to be opened with /Applications/TextEdit -t Causes the file to be opened with the default text editor, ...


3

if has("x11") echo "yep" endif


2

It looks like you have large spacing between all lines, not just the statusline. That can be controlled via the 'linespace' option. :set linespace=0 reduces the additional spacing to none. Since this is the default, find the place where this got changed (via :verbose set linespace?), and remove that, or add the above to your .gvimrc.


2

When you clone a colorscheme, you need to adapt the g:colors_name inside the script; its value must be identical with the changed name. That's because the following snippet of syntax/synload.vim will re-load the colorscheme: " Set the default highlighting colors. Use a color scheme if specified. if exists("colors_name") exe "colors " . colors_name else ...


2

You can add the following to your gvimrc or wrap in a has("gui_running") check in your vimrc autocmd VimLeave * :!open -a Terminal to bring Terminal to the front when MacVim quits. This uses the open command to open a new Terminal Window or bring the current one to the foreground. Change Terminal to iTerm2 if you use iTerm2


2

Also possibly useful: + and - will move the cursor up or down, respectively, to the first non-blank character.


2

I also wanted to modify one line at a given moment during a diff. So I created a simple map and put them in my vimrc file. nnoremap <silent> <leader>dp V:diffput<cr> nnoremap <silent> <leader>dg V:diffget<cr> You could use do instead of dg, but I am more used to thinking "diffget" instead of [o]btain. For your bonus, ...


1

My problem was mainly that MacVim opened, read, and wrote especially slowly (sometimes upward of 15 seconds). mvim --startuptime revealed that sourcing files from .vimrc and the runtime/ directory was taking most of the time, and the problem was solved by adding the line: set rtp+=/usr/local/Cellar/macvim/7.4-73/MacVim.app/Contents/Resources/vim As you ...


1

let @/ = "pattern" is indeed the correct approach. You can influence the direction via the special v:searchforward variable. Go to the next match via :normal! n. The problems with search highlighting are probably related to the execution within a function, see :help function-search-undo. You can still use a function to calculate the pattern, etc. but the ...


1

Try mvim filename You might have to set your PATH depending on how you installed it. Take a look at http://stackoverflow.com/questions/2056137/how-to-run-mvim-macvim-from-terminal


1

You may enter in the quick-command mode (<C-o>) and then forward-delete (<S-c> or <S-d>).


1

I don't want to install xcode just for this, also I don't want to use aliases or brew method (which also requires xcode) so I do this: I first download MacVim from the releases page, Then I install MacVim by dragging it to my Applications folder, For terminal usage, there's also a terminal app in the zip, called mvim, I install it by running this command: ...


1

I was used to Home/End getting me to the start and end of lines in Insert mode (from use in Windows and I think Linux), which Mac doesn't support. This is particularly annoying because when I'm using vim on a remote system, I also can't easily do it. After some painful trial and error, I came up with some .vimrc lines which do the same thing, and ...


1

$ mvim -v file.txt does what you want. You should alias vim to mvim -v, IMO.


1

If google says "no", the answer must be "no", right? But… what about creating it yourself with lokaltog's powerline-fontpatcher? After all, that's what everybody did before he made that font pack available.


1

Your file freezes my Vim too. The cause is Vim's suboptimal syntax highlighting routines that choke on long lines such as 63, 66 and 69 (69 is 3342 chars long!). You can reduce the value of 'synmaxcol' to a lower value than the default (3000) like 200 or something, YMMV: :setlocal synmaxcol=200


1

The sessions functionality you mentioned is what you want, but you need to pass it an option to make it save buffers as well as open files and positions. You can use :mksession for this. However, :mksession is still manually controlled; although you can bind it to hotkeys for quick save/restore functionality, if you forget to run the command, you lose your ...


1

Have a look at the following plugins: Indent Guides indentLine.vim



Only top voted, non community-wiki answers of a minimum length are eligible