|
Plorkyeran posted:Ctrl-V, Enter should work.
|
# ? Apr 11, 2014 16:14 |
|
|
# ? May 8, 2024 06:29 |
|
Destroyenator posted:Combining with visual mode can be pretty powerful too: Whoa, using visual mode hadn't occurred to me, that's awesome.
|
# ? Apr 11, 2014 21:32 |
|
For those of you with a mechanical keyboard1: Showcase your favorite editor on your keyboard. Buy a Vim keycap in a group buy. Deal ends on/around 2014-04-25. 1 With Cherry MX key switches
|
# ? Apr 18, 2014 13:48 |
|
Any tips or good plugins for writing HTML with vim? Two things that I'd find really helpful: A command to jump from a tag to the corresponding close tag (like jump from <div> to </div>) A command to replace the contents of the open and close tag at the same time (like if I replace <h1> with <h2> it will simultaneously replace </h1> with </h2>)
|
# ? Apr 25, 2014 11:57 |
|
fuf posted:Any tips or good plugins for writing HTML with vim? The HTML ones I could not live without are: Snipmate: https://github.com/garbas/vim-snipmate Define your own snippets to poop out blocks of HTML you use frequently quickly Sparkup: https://github.com/tristen/vim-sparkup Write HTML super fast! Non-plugin command that is wonderful for HTML (which you probalby already know): cit Will, from anywhere in the contents of a tag (say, the text inside an H1) remove it and put you in edit mode. Those thing you find helpful would be very, very cool. I don't know if they exist, but it makes me want to learn to write vim plugins.
|
# ? Apr 25, 2014 16:36 |
|
Thanks Lumpy! I feel like pretty much every thread I ask a question in you are usually the one who provides a useful answer!
|
# ? Apr 25, 2014 17:00 |
|
I don't even use vim full time, but you'll probably find emmet.vim really useful. It's great on sublime text. e: It seems sparkup does the same thing and if Lumpy is recommending it, it must be better. sharktamer fucked around with this message at 17:05 on Apr 25, 2014 |
# ? Apr 25, 2014 17:03 |
|
fuf posted:A command to jump from a tag to the corresponding close tag (like jump from <div> to </div>) Place cursor over div, and press %. fuf posted:A command to replace the contents of the open and close tag at the same time (like if I replace <h1> with <h2> it will simultaneously replace </h1> with </h2>) I don't do much with markup, but a plug-in I use all the time for refactoring is vim-multiple-cursors. Without changing its configuration, you'd put your cursor over the first h1, hit <C-n> twice to enter multicursor mode and select the current word, hit <C-x> once for each of the nested h1s you have , and when it highlights the closing h1, press c then type h2. If you don't have any nested h1s, that'd reduce to <C-n><C-n>ch2<Esc>. Usually when I'm refactoring my code, I want to replace all of my variable names, so I can just mash on <C-n> until everything is matched, but sometimes that granularity of being able to skip some matches comes in handy. The Laplace Demon fucked around with this message at 18:25 on Apr 25, 2014 |
# ? Apr 25, 2014 18:22 |
|
fuf posted:Any tips or good plugins for writing HTML with vim? He (accidentally?) wiped the readme, but I always liked Tim Pope's Ragtag. There's a walkthrough here, it's similar to Emmett/Sparkup though admittedly with less features.
|
# ? Apr 28, 2014 04:54 |
|
Learned about bufdo today and it saved me loads of headaches. If any of you need to execute a command across many files, take a look at it.
|
# ? May 7, 2014 17:53 |
|
Lumpy posted:Sparkup: https://github.com/tristen/vim-sparkup Update: I can't live without this now. I still haven't quite found a solution for this one though: fuf posted:A command to jump from a tag to the corresponding close tag (like jump from <div> to </div>) This doesn't work unfortunately: The Laplace Demon posted:Place cursor over div, and press %. (it jumps from between the opening and closing brackets of <div>, but not from <div> to </div>) The closest thing I've found is this plugin which highlights the closing tag (pretty useful in itself): https://github.com/gregsexton/MatchTag http://www.vim.org/scripts/script.php?script_id=3818 If I knew how I'd edit the plugin code to add a way to jump between matched tags.
|
# ? May 9, 2014 17:13 |
|
fuf posted:(it jumps from between the opening and closing brackets of <div>, but not from <div> to </div>) Oops, I use sensible.vim, which automatically runs runtime! macros/matchit.vim. That macro has been included in vim since 6.0, and it's what adds the jump between tag behavior.
|
# ? May 9, 2014 17:30 |
|
The Laplace Demon posted:Oops, I use sensible.vim, which automatically runs runtime! macros/matchit.vim. That macro has been included in vim since 6.0, and it's what adds the jump between tag behavior. Oh hey it works! Thanks.
|
# ? May 9, 2014 18:04 |
|
I used to have a shortcut that would open a fullscreen list of all open buffers that you could scroll through and switch to with <enter>. It wasn't :ls, and I'm sure it wasn't a plugin. Any ideas?
|
# ? Jun 18, 2014 17:48 |
|
Anyone tried out trackperlvars.vim yet? It's a handy plugin for dealing with Perl variables since it understands the different variable types (so it doesn't get confused when you want to move from definitions to uses, or globally rename a variable), but it's also supposed to highlight all uses of a variable when you put the cursor over one and that part doesn't seem to be working. e. Turns out it only defines highlights for terminal Vim. Easily fixed. jony neuemonic fucked around with this message at 18:50 on Aug 10, 2014 |
# ? Aug 8, 2014 05:18 |
|
I have become addicted to Vim keys / modal editing for programming, and also completion for C++. The problem is, what I'm using for completion/semantic completion, YouCompleteMe, while it works well, makes Vim slow to a crawl after an unpredictable amount of time between 30 minutes and two hours. I have tried everything to resolve this and it appears to be a YCM issue that the developer is unwilling/unable to address. I know there are several other options, a big one being NeoCompleteCache, but I just want to hear what people are using for this and what has worked well for them instead of trying out a hundred other plugins and realizing I don't like them. Has anybody found a C++ completion engine that just works? A big bonus is the ability to do semantic completion based on standard libraries, and an even bigger bonus is the ability to do semantic completion on third-party libraries, but I'm willing to go with something that's a little simpler, as long as it gets variable names and such. Should I just suck it up and buy Sublime2/vintage mode? Does that emulate the whole modal editing thing sufficiently?
|
# ? Aug 12, 2014 19:35 |
|
clang-complete works in much the same way as YCM. I used it for a long time before switching to YCM.
|
# ? Aug 12, 2014 19:54 |
|
The Gay Bean posted:I have become addicted to Vim keys / modal editing for programming, and also completion for C++. The problem is, what I'm using for completion/semantic completion, YouCompleteMe, while it works well, makes Vim slow to a crawl after an unpredictable amount of time between 30 minutes and two hours. I have tried everything to resolve this and it appears to be a YCM issue that the developer is unwilling/unable to address. I ran into the same issue, and in the end I just stopped using YCM. I use ctags quite a bit for my auto-complete, although that doesn't help much with libraries. Instead, now I just read the documentation in Dash or Zeal, which is definitely not as efficient.
|
# ? Aug 13, 2014 04:40 |
|
I actually figured this out. It turns out that I was syntax highlighting was slowing everything down, so I added "syntax sync minlines=256" to and took out "set t_Co=256" from my vimrc and it's fast.
|
# ? Aug 14, 2014 07:26 |
|
Hey guys, I'm transitioning into using vim for my script writing at work and was curious if anyone has developed powershell scripts in vim before. Syntax highlighting exists, but I'm curious if there are any code completion extensions, because the only thing really keeping me on the Powershell ISE is the sheer awesomeness of Show-Command and Out-GridView for when I need to visualize the actual powershell objects. It might be that I should be in the mode of "using the right tools for the right job" but if I could keep the focus entirely in vim for my script writing then I think that would make more sense productivity wise.
|
# ? Aug 18, 2014 18:19 |
|
Does anyone know if there is a way to customize the behavior of spell check based on syntax. For example, I currently have it configured to only spell check strings and comments; however, a lot of the times in the comments I may refer to a function or class by name (which it will obviously interpret as misspelled). Ideally I would like for spell check to automatically add all class and function names to the dictionary that way when they are referred to in the comments, it is only marked as misspelled if it's a) not a word and b) not a valid function or class name.
|
# ? Sep 3, 2014 18:19 |
Is there a git plugin that will add an extra column beside the line numbers telling me if a line is added or changed? I had that feature in an IDE and thought it was pretty handy. I already have fugitive but haven't seen anything about displaying diff stuff inline. Thanks edit oh duh never mind, it is a feature of fugitive
|
|
# ? Jan 7, 2015 19:12 |
|
I just saw these days someone who used this: https://github.com/airblade/vim-gitgutter
|
# ? Jan 7, 2015 20:42 |
|
Relevant to folks here probably, the vi/vim beta stackexchange thing launched: http://vi.stackexchange.com/
|
# ? Feb 19, 2015 20:24 |
|
If I interact with vim exclusively through ssh to a cluster of computers I don't control (my university's computer lab), how much can I do to make C code easier to edit? For my first couple of projects I've gone with vim as a pure editor, meaning that there's no intellisense or any real assistance from vim at all. Just basic syntax hilighting seems to work out of the box. Most of the info in the OP seems to assume that I have access to install plugins, which I don't. Can I do anything to make my life easier? I tried working on my projects in Visual Studio for a while, but most of our projects depend on Linux syscalls and target the Linux environment so it proved to quickly become too annoying to constantly scp my source back to the lab computers to test it.
|
# ? Feb 20, 2015 16:41 |
|
LeftistMuslimObama posted:If I interact with vim exclusively through ssh to a cluster of computers I don't control (my university's computer lab), how much can I do to make C code easier to edit? For my first couple of projects I've gone with vim as a pure editor, meaning that there's no intellisense or any real assistance from vim at all. Just basic syntax hilighting seems to work out of the box. Most of the info in the OP seems to assume that I have access to install plugins, which I don't. Can I do anything to make my life easier? If you have write access to a folder that you can always see, you could probably get Vundle to install packages to that folder, no?
|
# ? Feb 20, 2015 16:45 |
|
You could use a local vim to edit files on a remote server:code:
code:
|
# ? Feb 20, 2015 16:48 |
|
I've never been able to find an actual answer for this, if I'm trying to edit a file through scp on a password protected server that doesn't allow keys, how do I save the password so I'm not asked for it every time I save?
|
# ? Feb 20, 2015 17:02 |
|
Bognar posted:You could use a local vim to edit files on a remote server: I do have a home directory I can access. Forgive me, but do I put this in my .bash_profile? I am not a regular Linux user, so I'm learning as I go here. Similarly, how would I get vim to load plugins installed to my home directory?
|
# ? Feb 20, 2015 18:05 |
|
OK, so I figured out how to use vundle and make a vimrc, but it looks like clang_complete needs clang installed to work. How would I go about installing clang to my home directory? All the installation steps I can find assume I have full control of the machine.
|
# ? Feb 20, 2015 18:32 |
|
LeftistMuslimObama posted:OK, so I figured out how to use vundle and make a vimrc, but it looks like clang_complete needs clang installed to work. How would I go about installing clang to my home directory? All the installation steps I can find assume I have full control of the machine. When you do the ./configure step you can pass it --prefix=~/some/homedir/path and when you do make install it will go there.
|
# ? Feb 20, 2015 19:52 |
|
Marsol0 posted:When you do the ./configure step you can pass it --prefix=~/some/homedir/path and when you do make install it will go there. Cool. Are these the right steps: http://clang.llvm.org/get_started.html Checking out llvm is taking forever!
|
# ? Feb 20, 2015 20:07 |
|
LeftistMuslimObama posted:Cool. Are these the right steps: http://clang.llvm.org/get_started.html It's not a small thing and in the end may not work out if you have any time constraints where fussing with it gets in the way of actual work. In that case I'd suggest looking into tags with vim. That should be simple to set up and it'll give you completion of your own code and an easy way to bounce around in it.
|
# ? Feb 21, 2015 08:23 |
|
Well, it turns out the versions of GCC and Python on the school's computers are too old to even build llvm and clang. I don't suppose there's any other ways to get basic code completion for the standard C libraries, is there? I mostly just want it to catch when I typo printf to pritnf for the millionth time and remind me what the parameters are for library functions. Popping back and forth between the terminal and manpages is time-consuming when I just can't remember the order of parameters for a certain function.
|
# ? Feb 23, 2015 18:14 |
|
The only C code completion plugins I know of (YouCompleteMe and clang-complete) rely on clang. Also this is not really a helpful suggestion but you could always just open the man pages from inside vim with :!man 2 open
|
# ? Feb 23, 2015 18:22 |
|
You can use shift-k to look up the word under the cursor
|
# ? Feb 23, 2015 18:37 |
|
You can also use ctags for basic completion (and navigation).
|
# ? Feb 23, 2015 20:01 |
|
LeftistMuslimObama posted:Well, it turns out the versions of GCC and Python on the school's computers are too old to even build llvm and clang. I don't suppose there's any other ways to get basic code completion for the standard C libraries, is there? I mostly just want it to catch when I typo printf to pritnf for the millionth time and remind me what the parameters are for library functions. Popping back and forth between the terminal and manpages is time-consuming when I just can't remember the order of parameters for a certain function. Build a newer version of gcc, and then use it to build clang
|
# ? Feb 24, 2015 14:17 |
|
I'm in a Windows environment at work and mainly write a lot of single-file scripts to help with day to day workflow. I've been using sublime and am interested in learning Vim, just cause. Is there any reason I should use standard Vim instead of gVim?
|
# ? Jun 22, 2015 03:34 |
|
|
# ? May 8, 2024 06:29 |
|
Hughmoris posted:I'm in a Windows environment at work and mainly write a lot of single-file scripts to help with day to day workflow. I've been using sublime and am interested in learning Vim, just cause. Is there any reason I should use standard Vim instead of gVim? Not as far as I know - gVim's GUI is pretty minimal, and can be turned completely off if it bugs you. I don't think there's a way to get hi-color mode (i.e. nice, pretty colorschemes) to work in the standard windows console version of vim. I think you may be able to get that working in cygwin or mingw but I've never tried because Anyway, vim and gvim will both use the same config file, so you can switch back and forth effortlessly.
|
# ? Jun 22, 2015 03:55 |