Hot answers tagged vimrc
From this stackoverflow answer, by skinp :w !sudo tee % I often forget to sudo before editing a file I don't have write permissions on. When I come to save that file and get a permission error, I just issue that vim command in order to save the file without the need to save it to a temp file and then copy it back again.
Please do not vote me down for this. I do not recommend implementing this answer, but it is the answer that the rkthkr is asking for. rkthkr said: But it would be nice to have vim restarted and run as root The way to do this is with :!sudo vim % As I mentioned to ipozgaj, a % as an argument (even a sub-argument) gets replaced with the path to the ...
You want to set option scrolloff: 'scrolloff' 'so' number (default 0) number of screen lines to keep above and below the cursor. This will make some context visible around where you are working. Use e.g. :set scrolloff=10 to always keep at least 10 lines visible.
$ vimtutor for starters. I remember Emacs has a tutorial of some sort from back when I was choosing an editor, but I don't remember what it is. I'd say learn enough about both to be able to function, then pick one or the other and master it (as much as possible--I'm finding after 7 years of using Vim that there's always lots to learn).
In order to make it permanent, you should add that to your ~/.vimrc file. That's a personal vimrc, as opposed to the system wide one that you're probably looking at. The syntax is slightly different, so what you would do is add the line colors desert to your local config file, again that's ~/.vimrc and you're good to go.
From the help in vim for CTRL-V-alternative: Since CTRL-V is used to paste, you can't use it to start a blockwise Visual selection. You can use CTRL-Q instead. You can also use CTRL-Q in Insert mode and Command-line mode to get the old meaning of CTRL-V. But CTRL-Q doesn't work for terminals when it's used for control flow. These lines are ...
From man screen: -e xy specifies the command character to be x and the character generating a literal command character to y (when typed after the command character). The default is "C-a" and `a', which can be specified as "-e^Aa". When creating a screen session, this option sets the default ...
Make sure the locale is installed on the system (debian/ubuntu: aptitude install locale) On the shell: setenv LANG In vim: :language In vim: :set encoding=utf-8 Try again and tell me if it works I also found this while googling: http://raviratlami1.blogspot.com/2007/04/how-to-write-hindi-in-linux.html and thats the vim docu: ...
vimtutor is an excellent tutorial for you to go through. Also the built-in help in vim is very nice. Use :help inside vim for explanation about practically anything related to vim. And of course there's Vigor, a User Friendly cartoon turned into reality. :-)
like what martian said. the syntax file should live under ~/.vim/syntax/todo.vim the plugin file should live under ~/.vim/filetype.vim setting those will probably resolve your issue with detection, since the syntax in your filetype.vim seems correct. what might be a funny issue is to have problems due to writing setfiletype todo instead of ...
The best thing I've learned recently is using jj instead of <esc> to enter normal mode: imap jj <Esc> Also, if you make use of splits via the split (tall terminal) or vsplit (wide terminal) command, then remapping the switch-split command is invaluable; I use , (comma) to switch amongst my splits: map , <C-w><C-w> Check out the ...
I usually save it to a temporary file in $HOME/tmp/apache.conf (for example) then sudo vimdiff $HOME/tmp/apache.conf /etc/apache2/apache.conf this is some extra work to merge the changes but it paid off. I find it to be a nice way between convenience and measurements against unwanted changes Before that I was thinking of ACLs or assigning corresponding ...
Only top voted, non community-wiki answers of a minimum length are eligible