My vimrc File
I’ve launched myself into the 21st century by putting this stuff up at GitHub – http://github.com/derekwyatt/vim-config.
Vim… and stuff
I’ve launched myself into the 21st century by putting this stuff up at GitHub – http://github.com/derekwyatt/vim-config.
Sean:
October 15th, 2009 at 6:47 pm
I found a number of useful bits from your file that I didn’t know about or hadn’t thought of. Thanks for posting it! Nicely organized too.
nix:
November 2nd, 2009 at 1:39 am
Thanks for all the tips. On a side note; in command mode “x” deletes the character but doesn’t move back a space. Did I missing something?
Derek Wyatt:
November 2nd, 2009 at 4:37 am
No, that’s what ‘x’ is supposed to do. If you want it to behave more like backspace then you might want to try ‘X’ instead (i.e. shift-x).
nix:
November 2nd, 2009 at 11:52 pm
Thanks Derek.
nix:
November 2nd, 2009 at 11:58 pm
Hello,
I actually tried it with and without the settings, Deleting ‘x’ at the end of the line; the cursor moves back a space.
IE: The Fuzzy Rabbit$
The Fuzzy RabbiX
The back space operation of the ‘x’ at the character before the $ moves back one space. No where else does this happen. In the middle of a line it stays in it’s current position.
But the Shift X works the way the old ‘x’ works. Test it out: cause I am on new meds. :-(
Nix
nix:
November 3rd, 2009 at 12:18 am
Did some more testing; it’s related to :set ve=”"
1) At the end of line $ deleting a character will shift the cursor to the right most column with :set ve disabled. IE: Last character is in column 13 deleting 13 would shift the cursor over to column 12.
2) In the middle of the line the cursor will stay in the same column and shift the other characters from the right side to the left side by column. With set ve = “” IE: cursor under column 5; hit ‘x’ the cursor remains in column 5 and the text to the right of it will be move to the left.
3)Using a Shift X will delete the character behind the cursor.
So using :set ve=all I have to be one column past the eol $. to get the desire effect for ‘x’ to work
PS: blame the meds. Thank you for your input.
PSS: I know this isn’t vim support; but if you have an answer; that would be awesome.
Best regards
nix:
November 3rd, 2009 at 12:27 am
My last and final post; sorry about being a pest:
Fix the x command in virtualedit mode
http://vim.wikia.com/wiki/Fix_the_x_command_in_virtualedit_mode
Your input helped out a lot and it’s greatly appreciated. Have a great day/week.
Derek Wyatt:
November 3rd, 2009 at 4:06 am
I check posts this morning and find you’ve asked and answered your own question. Nice :)
I probably wouldn’t have been able to help much though. The normal behaviour of ‘x’ has never seemed surprising. At the end of the line, the cursor moves because without virtual edit, you can’t go beyond the end of the line so the cursor must be moved. Virtual edit is an enhancement to Vim to let it do different stuff, not to correct “incorrect” behaviour. But if it works for you, then cool!
Matt:
November 9th, 2009 at 11:18 pm
I don’t like shifting my hand one key over every time I change between normal and insert modes, so I did this:
map j <Left>
map k <Down>
map l <Up>
map ; <Right>
map h <Nop>
nnoremap <c-e> ;
vnoremap <c-e> ;
I also use the first five lines in my vimperator, mutt, and vifm configs.
legolas:
January 9th, 2010 at 11:39 pm
Hi Derek,
I’ve one problem. I’ve enabled the source explorer plugin,NERD Tree, and TagList plugins. But when I search for any specific word by pressing +* it doesn’t get highlighted. Can you please help me to find out the settings for this thing..
Thanks in advance..
Legolas
legolas:
January 9th, 2010 at 11:41 pm
Hi Derek,
For your more information. I’ve also set the hlseach in my vimrc file.
Derek Wyatt:
January 10th, 2010 at 4:52 pm
Hi Legolas,
There are a few things to try, but first I just have to get this out of the way… you wrote that you do ‘+*’, which is two commands and the first one (+) will put the cursor one line downward. If you are actually doing that, and it wasn’t just a misprint, then don’t :) All you want to hit is ‘*’.
Now, for the other bits…
- Try typing ‘:set hls?’ and see what happens. If it says ‘nohlsearch’ then even though you’ve set ‘hlsearch’ in your vimrc, something else is turning it off.
- Try explicitly typing ‘:set hls’ and then hit ‘*’. Does it highlight now? Again, it’s getting turned off by something.
Give that stuff a go and see what happens. If you suspect that something else is resetting it for you, then type ‘:verbose set hls?’ and it should tell you what file was responsible for setting it last (you might have to restart Vim to get a “fresh” setting since you probably set it from the command line manually). See ‘:help set-verbose’ for more information on that one.
James Tiet:
April 4th, 2010 at 4:55 am
Thanks for your post,I learn a lot from your vimrc file
nix:
April 11th, 2010 at 8:13 pm
Hope your hose move is going well.
I have learned a lot from the videos as well as the configuration files. Just thought I might pass along some things you or some of the viewers might find useful.
The pasting/putting here grabs from the clipboard; one and the same on windows not so in the *nix world (cut buffer, select buffer and clipboard). However the text doesn’t get fouled up when pasting or putting. So, this might be quite similar to your “paste mapping”. I think it has some additional nice touches (putting before or after a location; putting over a visual selection). I should play with paste more before making that statement. :help put for details.
” Paste from X11 clipboard. Vim has to be compiled with clipboard
” support. gVim shouldn’t have a problem.
map ,p “+p
map ,P “+P
” Yank from vim to X11 clipboard. Not sure how this works under
” Windows. Does a “yy” copy to windows clipboard? If it doesn’t
” This might be useful; if it works the same way or ctrl-c &
” ctrl-v in windows.
map ,y “+y
” Paste with indents. My fingers don’t like [ ] . Must be out
” of shape. Well, I am oval; just kidding.
map ,ip ]p
map ,iP ]P
” Fun with buffers.
” List buffers and select one file to open.
nnoremap ,b :ls:tab sbuffer
” If you know the buffer number:
cnoremap ,ob tab sbuffer
On a side note to all; I have buffers redirected to tabs; even from the buffer list. I kind of got hooked on tabs (omg).
“Switch buffer to tabs. :help switchbuf for details.
set switchbuf=usetab,newtab
Missing the video Derek. Hope things are going well.
nix:
April 11th, 2010 at 9:10 pm
PS: I should mention that in xterm I have:
SelectToClipboard: true
This changes the way cut/select/copy/paste works in xterm and vim. Also some apps like xpdf & xterm don’t play nice when the clipboard option is set. Play with the vim settings and the xterm settings.
Should have mentioned it up front. What does “SelectToClipboard”? If you select or highlight something in xterm; it copies it a clipboard so in some GUI app you can use ctrl-v instead of middle clicking. Yes, the mouse is bad.
nix:
April 11th, 2010 at 10:58 pm
PS: I have one question; if you have time:
nmap ,n :set invhls:set hls?
What is the question mark used for after the hls. I tried to set wrap and linebreak in one command. It works; but seems like I kind of riggged it. Not sure if it’s proper.
cnoremap ,wl set invwrap invlinebreak:set wrap? linebreak?
There might be some cruft.
Derek Wyatt:
April 23rd, 2010 at 2:39 am
Hey dood. The question mark merely displays the value. Because this is a toggle switch, it’s nice to know what the value is after it’s been toggled.
jojomonkey:
October 4th, 2010 at 8:53 pm
thanks. lost my vimrc from a while ago. brushing up on vim since have been using eclipse mainly for some time. your videos are a great refresher and some new stuff for me. your vimrc is great.
Rick Sinclair:
December 7th, 2010 at 8:25 pm
Thanks for this Derek! I’m sure it will help me learn what a good vimrc file should have and look like! (;
kuddl:
January 10th, 2011 at 1:40 pm
Hi Derek,
thanks for the videos.
I will definitly give vim another try. I tried it already a couple of times and always failed …
One thing:
nmap ,w :set invwrap:set wrap?
=> it’s not working. I’m on OSX 10.6.5 with the default VIM 7.2.108.
Any ideas?
tania5:
January 15th, 2011 at 10:31 pm
Alright, I
blaine:
August 31st, 2011 at 11:43 am
Hi Derek. I’ve been enjoying your videos, thank you. It appears your github link is invalid so I can’t check out your .vimrc file.
Derek Wyatt:
August 31st, 2011 at 12:23 pm
Thanks… fixed!
mdctars:
July 13th, 2012 at 1:46 am
Hello Derek,
I’ve watched your videos, they’re great (Y)
I want to have the same configuration on vim as you. I’ve downloaded
your configuration files from github and copied into my ‘vimfiles’ folder (I’m using windows), but it doesn’t work. I must be doing something
wrong.
Can you please tell me how to get the same configuration as your vim has ?
Derek Wyatt:
July 13th, 2012 at 3:42 am
There shouldn’t be much to it. Toss the files in %HOME%\vimfiles and copy the _vimrc to %HOME%\_vimrc and you should be good to go.
mdctars:
July 13th, 2012 at 6:02 am
I did exactly that but when I launch vim it says “Press ENTER or type command to continue”. and when after I press ENTER vim launches and
there is some errors on the bottom with red color
“E117: Unknown function: fugitive#statusline
E15: Invalid expression: fugitive#statusline()”
Derek Wyatt:
July 13th, 2012 at 6:11 am
You need to update all of the plugin bundles. There are a couple of scripts to do this, which won’t work on Windows but they should make it easy to figure out what to do. In the vimfiles/bundle directory, you can see ‘get’. If you were to run ‘get’ with no arguments, it would pull all of the plugins defined in the ‘from_github.md’ file down onto your system.
Once you’ve got them, you’re good to go.
mdctars:
July 13th, 2012 at 6:41 am
How to run ‘get’ ? I tried to run it with cmd but without success.
By the way I installed vim on ubuntu 12.04 added your configuration and got the same result. Is there any scripts which would work for ubuntu in order to get your configuration ?
Derek Wyatt:
July 13th, 2012 at 6:43 am
Like I said, it won’t work on Windows. You’ve got to manually pull all of the git stuff using git. Look at the script, and it should give you a good idea of how to get it done.
‘get’ should work just fine for Ubuntu. I use it all the time.
mdctars:
July 13th, 2012 at 6:57 am
Thanks :) I’ll look at the script.
one more question :
I’m new for linux so I don’t know how to execute ‘get’ script.
Should I type ‘get’ in terminal or what ?
Derek Wyatt:
July 13th, 2012 at 6:59 am
Yup, just run it. If it doesn’t work, try going into the ‘bundle’ directory and running ‘./get’. If that doesn’t work, run ‘chmod 755 ./get; ./get’. You’re going to need ‘git’ installed so if you don’t have it, run ‘sudo apt-get install git’ and then run ‘get’.
mdctars:
July 13th, 2012 at 7:17 am
I guess i screwed up my gvim on ubuntu :| when i start vim and press ‘i’ in order to switch to insert mode, there isn’t mark in bottom that i’m switched to insert mode and it is doing strange things like: when i hit backspace it doesn’t delete letter, when i hit escape it doesn’t switch in normal mode but it deletes last character o_O.
I uninstalled it, removed vim folder and installed again but there is no change. :(
Is there any ideas how to bring normal vim back ? :(
mdctars:
July 13th, 2012 at 7:24 am
p.s. Vim still executes while it’s uninstalled from software center and when i’m typing :r $VIMRUNTIME
red line appears
‘E484 Can’t open file /usr/share/vim
Derek Wyatt:
July 13th, 2012 at 7:25 am
There’s not much more we can do in this comment section. I recommend you go to the Vim discussion mailing list (head to http://www.vim.org and the link is there). They’ll recommend that you run Vim with no configuration (i.e. vim -u NONE -U NONE).
As well, gvim and vim are the same. gvim is just running ‘vim -g’ so there’s no difference there.
You’ve messed up the install somehow… You should probably wipe vim off your system entirely (linux help for that) and then install it fresh.
mdctars:
July 13th, 2012 at 7:29 am
ok. thanks :)