Tag Info

New answers tagged

0

I have spent an 2-3 hours to figure it out. that how to configure this color scheme with vim. Make sure do not start tmux first. Some time it mass with terminal color scheme. (1) set syntax on (2) :echo &t_Co in vim and see what you get. If it's 8 you'll want to set t_Co=16 and if it's 256 than set t_Co=256 (3) if you have set t_Co=256 than next is ...


0

You probably want the :edit command instead of the :read command. But the :edit command would fail if you had unsaved changes in Vim, so you have to force it with a !. Also, I don't know why you have a | preceding the command, as it doesn't belong there. Try this: au! FileChangedShell img.dat e!


0

In 10.10 Yosemite (not sure about previous versions) you can scroll down using the trackpad or a mouse the same way you would a webpage. Put the mouse over the Terminal window, and scroll using the mouse wheel or two fingers on a touchpad.


1

^@ not a bad character if you use a proper encoding, but if you want to remove then try: tr -d '\000' sed 's/\000//g' ^M character is there in your example data To convert your file to Unix/Linux format before any processing, try: dos2unix filename - rhel and other dos2ux filename [newfilename] - HP-UX


1

In my case it was good enough to comment out the fullscreen part of the extended.vim config file found under ~/.vim_runtime/vimrcs/extended.vim. Look for the if has("gui_macvim") in that file and comment out that entire block and you should be able to start MacVim in windows mode. Side note, I've also turned off the native fullscreen support for MacVim ...


0

In the Settings menu, choose the profile to edit, then press the Edit… button highlighted in the screenshot and add these lines: TERM=xterm-256color COLORTERM=1 (from my colorscheme's wiki)


0

:so % if currently editing .vimrc


0

For those people that want to move the cursor in command line mode, take a look at this blog post. I ended up adding eight lines in my vimrc; " Needed for tmux and vim to play nice " Needed for tmux and vim to play nice map <Esc>[A <Up> map <Esc>[B <Down> map <Esc>[C <Right> map <Esc>[D <Left> " Console ...


0

grosshat's solution doesn't work. Probably need to refer to Zsolt Botyaki's answer over on SO: You can't do that without setting up a wrapper function for it, AFAIK. function! MakeSession() let b:sessiondir = getcwd() let b:filename = b:sessiondir . '/session.vim' exe "mksession! " . b:filename exe "edit! " . b:filename exe "g:^cd :d" exe ...


1

For those who would like a more readable solution, the following is what I have in my .vimrc " Relative or absolute number lines function! NumberToggle() if(&nu == 1) set nu! set rnu else set nornu set nu endif endfunction nnoremap <C-n> :call NumberToggle()<CR> The cool thing about this is that ...


1

I believe this is a bug, that has recently been fixed. Please update your Vim. Oh and in case of the mobaxterm, this also seems to be a bug of the mobaxterm


0

Add the following keybindings to your .zlogin: bindkey '\e[3~' delete-char bindkey '^r' history-beginning-search-backward bindkey '^g' history-beginning-search-forward bindkey -s '^l' '^qcls\n'


0

For the sake of anyone stumbling upon this later: I combined the two methods mentioned in @madmax1's answer and comment, to make Vim choose the appropriate method of help automatically depending on the filetype. function! GetHelpOnCwordInTab() if &filetype == "vim" execute 'tab help ' . expand("<cword>") else execute ...


0

I enter non-formatted plain new lines with <CR>. When I want to continue typing next line in the commented block I just use o key as usual. Try this: nnoremap <silent> <cr> :set paste<cr>o<esc>:set nopaste<cr>


0

If you don't mind that it moves the cursor, this works: noremap <ScrollWheelUp> H5k noremap <ScrollWheelDown> L5j


3

A quick answer :s/\(\(.\{-},\)\{8}\)/\1\r/g where .\{-} is a non-greedy match for anything, and \{8} is exactly 8 times the preceding \(pattern\). There's a answer using gqq that might interest you too. Add the line let @a=':s/\(\(.\{-},\)\{8}\)/\1\r/g' to your ~/.vimrc file then you can run this macro at any time with @a and return. Replace a by ...


0

camelcasemotion is a pretty handy vim plugin that allows you to move through words when using underscore or camelcase notation. Using this plugin you can place a comma in front of many of the traditional vim motion commands which will allow you to treat words in underscore or camelcase notation as full words.


1

It can be done, but it isn't very nice: vim -p bit.h byte.h -c 'vsplit bit.c | tabnext | vsplit byte.c'


2

Add set modeline to your vimrc, then add a line like this to the end of your httpd.conf: # vim: filetype=apache Of course, you can also do that with other files. See :help auto-setting for more information.


2

I'm not sure what you're trying to do. <s-k>, also known as K, opens the man page for the keyword under the cursor. I assume you want to create a mapping to open the vim help page for the keyword under the cursor. This can be done by this (i'll use <c-k> to not override K): noremap <c-k> :execute "tab h " . ...


0

Fix the issue by adding this line to the ~/.vimrc file: set t_Co=256


0

There is a plugin called CoVim which adds collaborative editing to vim.


2

Answering my own question, apparently some temporary information is stored about the file even when you do a :bd, and to "really" remove a file from Vim's memory, you have to do a :bw (bufferwipe). The temporary information about the symlink making the target open as the symlink seems like a bug in Vim, but in any case opening the original symlink again and ...


0

To make ÅÄÖ åäö work in vim, you need to set your Terminal client like PUTTY to use UTF-8. This has nothing to do with vim or .vimrc


0

I have no mapping bound to <ESC> globally or for Visual mode (calling :verbose vmap <ESC> gives no results) but there is still a significant delay when exiting Visual mode. Even on fresh installs with no vimrc the delay is present. Using <C-c> does exit visual mode without delay. Since I don't like pressing <C-c> to exit any mode, I ...


0

I'm not aware of any way to get vi controls system-wide on modern PCs. If you want, you can install vim-anywhere and/or homesick-vi-everywhere. They are both useful, but they don't quite let you use the vi controls system-wide. Still, there are dozens of applications (web browsers, PDF viewers, IDEs, etc.) which are controllable using vi controls. (Note: ...


16

From within Vim, :help key-notation or :help keycodes will bring up a list of conventions used within Vim's documentation (and typically copied by Vim users as well) to refer to various keys. One of the lines has this: notation meaning equivalent decimal value(s) ----------------------------------------------------------------------- ...


2

I am not sure if there is a general guide on vims documentation syntax. But from my experience < C-v> is equivalent to (ctrl + v). This can be seen for example in this cheat sheet. https://gist.github.com/awidegreen/3854277 And in this question on SO http://stackoverflow.com/questions/289681/why-does-c-a-ctrla-not-work-under-gvim-on-windows


2

In the output of --startuptime you can see what causes the long startup. 2918.472 2782.792 2782.792: sourcing /Users/<USERNAME>/.vim/after/syntax/css.vim 2921.846 2801.535 005.490: sourcing /usr/local/share/vim/vim74/syntax/html.vim 5725.565 2786.027 2786.027: sourcing /Users/<USERNAME>/.vim/after/syntax/css.vim 8505.199 2780.505 ...


0

I just had this problem on Ubuntu as well, all the shortcuts using Ctrl + something worked except for Ctrl+ws and Ctrl+wq. It turns out that the shell is swallowing the second part of the command, which is Ctrl+s / Ctrl+q. I've found that this solution fixed my problem: http://stackoverflow.com/a/13648667/1199685


0

I tried installing both ANSI and xterm-256color themes for OS X's Terminal and vim's color scheme with partial success. The ANSI colors were never imported in Terminal.app — which I expected, so I considered 2 options. Manually set the values clicking on each swatch, then using Color Sliders set to color space sRGB (!) and then entering them in RGB or HSB ...


1

vim-ipython is a filetype plugin, as evidenced by the fact that its main content resides in an ftplugin folder. It will not load, until you start editing a python file. Then it should load automatically.


0

I recently built a Markdown to vimdoc generator in Go, implemented as a custom renderer for the blackfriday Markdown parser: https://github.com/FooSoft/md2vim


4

What are my options? If you can run applications from a USB Stick try GVim Portable: The GVim Portable Launcher allows you to run GVim from a removable drive whose letter changes as you move it to another computer. The program can be entirely self-contained on the drive and then used on any Microsoft Windows computer. If you can run applications ...


1

:Bundle is a command provided by Vundle, a popular plugin manager. Read its README and documentation carefully. Using someone else's vimrc is a very bad idea, though. You should reconsider that decision as soon as possible.



Top 50 recent answers are included