Live data from Hacker News

Vim After 11 Years

statico.github.com

241–250 of 254 posts

Re: Vim After 11 Years

#241

> Emacs has a useful mode which highlights hexidecimal colors in CSS and SASS with the color represented by the text. http://www.vim.org/scripts/script.php?script_id=2937 > The biggest hole, however, is the lack of refactoring and smart completion. http://eclim.org/

Smart completion is fine to me, but the refactoring is a potential problems. It seems there isn't an open source refactoring tools as good as PyCharm for python.

Re: Vim After 11 Years

#242
post #217

My favourite ones: " Make Y behave like other capitals nnoremap Y y$ " Reselect visual block after indent/outdent vnoremap vnoremap > >gv

Curious - what's the point of retaining the selection after indenting?

Sometimes you want to indent more than once. This remap is fine, but the idiomatic way to do this is just to use a period to repeat the last command. It doesn't hurt to get used to that.

Re: Vim After 11 Years

#243
post #222

Earlier quoted context omitted.

How do you select text then? I'm sure there are ways, but they are certainly not intuitive and I've never bothered to look them up since I don't do this task as often.

Do you mean "select text from whatever is displayed in the terminal" or "select text in Vim"? I never select or copy anything from the terminal: pbcopy on the Mac OS X and xclip on Linux are what I use to get stuff from the shell into the system clipboard. I don't think that's what you ask, but in Vim, visual selection is done by hitting v (character-wise), V (line-wise) and Ctrl-v (block-wise) followed by a motion o…

Yes, I asked about terminal (this whole subthread was about mouse use in terminal). Thanks.

Re: Vim After 11 Years

#244
post #217

Earlier quoted context omitted.

Curious - what's the point of retaining the selection after indenting?

Sometimes you want to indent more than once. This remap is fine, but the idiomatic way to do this is just to use a period to repeat the last command. It doesn't hurt to get used to that.

Enter a number then any command to repeat it as many times as you want.

Re: Vim After 11 Years

#246
post #103

My new favorite toy: http://gh.codehum.com/nosami/Omnisharp/ It's 'real' intellisense for Vim/C#. It's fairly new and rough around the edges, but works great once you get it going.

I've been looking for something like this for months. I've also never heard of easymotion or YouCompleteMe. How is it that I've been out of the loop for all these things ??

Re: Vim After 11 Years

#247
post #98

I recently switched to Vundle from Pathogen and it is a joy to use. Best part: you can bootstrap[1] Vundle from your .vimrc, turning the two-part "vimrc & plugins" configuration into a one-part "vimrc" configuration. https://github.com/gmarik/vundle/blob/master/test/vimrc

I have a similar, yet different approach.

My approach also works even if git doesn't exist (by skipping vundler).

I need this since sometimes I work on systems that don't have every bell-and-whistle I could want.

https://github.com/docwhat/homedir-vim/blob/master/vimrc/.vi...

Re: Vim After 11 Years

#248
post #244

Earlier quoted context omitted.

Sometimes you want to indent more than once. This remap is fine, but the idiomatic way to do this is just to use a period to repeat the last command. It doesn't hurt to get used to that.

Enter a number then any command to repeat it as many times as you want.

Sometimes it's easier to see things line up.

Re: Vim After 11 Years

#249
post #149

Here are my 2 cents set undofile " This creates a undo file that persists your undo history when the file gets closed imap >> " Double right arrow to escape from insertion mode. This is faster and more comfortable (at least for me) than to reach for tab key for some people set clipboard=unnamed " This is bridges between your Vim yanks and your system clipboard

undofile sounds great! I didn't know about it. Some people use jj to go to the normal mode. Personally I remapped Caps Lock to Escape in my whole system, so I can go to normal mode easily. You can yank to the system clipboard by providing appropriate register to yank into. You do that by pressing "* before the yank command (e.g. "*yy to yank the current line).

I have some code to keep the undo/backup/swaps in a sane place... http://stackoverflow.com/questions/4331776/change-vim-swap-b...

Re: Vim After 11 Years

#250

Does any vim plugin support context sensitive auto-complete like Visual Studio (auto-complete only with variables that are alive in the current block of code)? I code in perl and am currently using ctags for autocomplete, but it doesnt autocomplete based on the context.

My .vimrc does this. I haven't used it much in perl (mainly bash, ruby, and python) but it should work fine.

https://github.com/docwhat/homedir-vim/blob/master/vimrc/.vi...

The important bits are vim's built-in omnicomplete and neocachecompl

Omnicomplete by itself isn't bad. I haven't seen any excellent documentation explaining how it all works, but even without my .vimrc I use C-X-f a lot to complete filenames.

Ciao!

Post reply on HN