Search Results

Search found 1891 results on 76 pages for 'vim registers'.

Page 13/76 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Indenting an x number of lines in vim

    - by Mack Stump
    I've been coding in Java for a job recently and I've noticed that I'll write some code and then determine that I need to wrap the code in a try/catch block. I've just been moving to the beginning of a line and adding a tab. 0 i <tab> <esc> k (repeat process until at beginning or end of block) Now this was fine the first three or four times I had to indent but now it's just become tedious and I'm a lazy person. Could someone suggest an easier way I could deal with this problem?

    Read the article

  • Use argdo with search pattern to delete line while suppressing errors and requiring confirmation in Vim

    - by richardh
    I use gVim 7.3.46 on Win 7. It is pretty straightforward to use argdo to search args files for a pattern and replace it while suppressing errors and requiring confirmation. :argdo %s/pattern/replace/gec | update However, I would like to delete entire lines that contain the pattern. I use the following. :argdo %/pattern/d | update But I can't suppress errors or require confirmation. Is there a way to do this? Thanks! (Also, is there a way to set "more" off? Thanks!)

    Read the article

  • How to disable autocmd or augroup in vim?

    - by Andrew Vit
    Given I have a group of commands such as: augroup MyGroup autocmd CursorMoved * silent call MyCommandOne() augroup END I want to disable all the autocommands in MyGroup for a time and then re-enable it later. Is there anything I can do with the group? Specifically, is there a way to disable the whole group at once? If not, what can I do to disable individual commands? Looking at the help, I only see a few options: augroup! will delete the whole group: I don't think this is right since I will want to re-enable it again. (But maybe there's a way to easily redefine the group again?) :noautocmd will only disable the callbacks for a one-off invocation of a command. (And it disables all autocmds, not specified ones) eventignore addresses the event binding, not the command: it sounds like it disables all bound commands for a given event, not just one command or a group I can specify. How is this done?

    Read the article

  • VIM - how to substitute a word in-place?

    - by psihodelia
    I would like to substitute a word in-place. For example, after yanking some word by pressing yw and then I set a cursor on some other word, then I would like to press something so that substitution will happen. (e.g. SOME_KEYw where w is really w and SOME_KEY is some key). I would not like to switch into Insert Mode. I am not interested in :%s/oldword/newword/gc solution. I need interactive in-place substitution!

    Read the article

  • Vim middle mouse click horizontal scroll

    - by vexe
    I'm running Windows 7 x64 with Gvim 7.4 Using my external mouse, I was wondering how to achieve 'horizontal scroll', I read all the documentation about it but still haven't figured out how to achieve it. 'horizontal scroll' to me means holding down the middle mouse button and moving the mouse horizontally. But that's just not working. Essentially what I want to achieve is something like this VS plugin. I know about zl/zh but I want to scroll horizontally from the mouse (by holding MMB and moving horizontally like I said, somehow, maybe?) So when does ScrollWheelLeft/ScrollWheelRight events get fired? Thanks.

    Read the article

  • vim: sending tab-completion key against a mapped keystroke

    - by CDR
    To switch between buffers without installing any plugins, a good way is to type :b <tab> Which shows all the current buffers names in status bar and you can pick one using cursor keys and enter. But :b <tab> is 5 keystrokes and I would like to map it to a <leader>. But setting the following is not working. :nnoremap <Leader>. :b <Tab> It shows ":b ^I" in status bar and doesn't actually open the buffer names on status bar. Anyone knows why?

    Read the article

  • Vim: Custom Folding for special doc

    - by Matthias Guenther
    Here is the code: package localhost import scala.tools.nsc.reporters._ import scala.tools.nsc.util.Position class MyReporter extends Reporter { /** <p> * Give message of an rejected program * </p> */ def info0(pos: Position, msg: String, severity: Severity, force: Boolean) = { severity match { case INFO => case WARNING => case ERROR => println("error on pos: " +pos+" message: "+msg) } } } So I want to to fold /** <p> * Give message of an rejected program * </p> */ to something like: /** */ How is this possible? Thanks for your help.

    Read the article

  • Map keys in Vim

    - by efficiencyIsBliss
    I want to map e to mean end of line. I tried the following mapping in my vimrc: map $ e $ is the default end of line command. However, this doesn't work. I'm wondering what the problem is. Also, I want to map Alt+right/left arrow to navigate words. So, for example, Alt+right arrow would take me to end of word. This command is currently mapped to e. Any tips on how I would go about doing this? Thanks!

    Read the article

  • vim: mapping <control-j> key

    - by bhh1988
    When I'm in insert mode, I sometimes want to be able to move around without using the arrow keys, and without having to go back into normal mode. So in my vimrc I've set up key bindings to do this: imap <C-l> <right> imap <C-h> <left> imap <C-k> <up> imap <C-j> <down> But for some odd reason the only one that doesn't work is the last one, . Doing this in insert mode just gives no response. I'm wondering why this might be, and I just don't know where to even begin looking for the problem. It doesn't appear to be mapped to anything since nothing happens when I do it, whether I'm in the terminal or in gvim. Any pointers would be great! Thanks!

    Read the article

  • VIM Window panes changing orientation

    - by Evan Carroll
    How can I go from a formation like this .......................................................... . . . . . . . 3 . . . . . . . . .............................. 1 . . . . . . . . 2 . . . . . . . . . . . .......................................................... to one like this .......................................................... . . . . . 3 . . . . . .......................................................... . . . . . . . . . . 2 . 1 . . . . . . . . . . ..........................................................

    Read the article

  • Setting up multiple highlight rules in vim

    - by ICR
    I am trying to set up rules to highlight both trailing whitespace and lines which are over a certain length by adding this to my .vimrc: highlight ExtraWhitespace ctermbg=lightgray guibg=lightgray match ExtraWhitespace /\s\+$/ highlight OverLength ctermbg=lightgray guibg=lightgray match OverLength /\%>80v.\+/ However, it only seems to pick up whichever is last. I can't find a way to get them to both work simultaneously.

    Read the article

  • Replace values in column, space delimited file in Vim

    - by user1256923
    I have a file that looks like: 2067 24311 <hkxhk> {00} 2069 17219 <hkxhk> {00} 2071 20931 <hkxhk> {00} 2073 5557 <hkxhk> {00} 2075 2127 <hkxhk> {00} 2077 20947 <hkxhk> {00} 2081 18088 <hkxhk> {00} I want to replace the first column value so that it looks like 5 24311 <hkxhk> {00} 5 17219 <hkxhk> {00} 5 20931 <hkxhk> {00} 5 5557 <hkxhk> {00} 5 2127 <hkxhk> {00} 5 20947 <hkxhk> {00} 5 18088 <hkxhk> {00} Where the first space delimited column has been replaced by a new value, in this case 5.

    Read the article

  • Vim script to compile TeX source and launch PDF only if no errors

    - by Jeet
    Hi, I am switching to using Vim for for my LaTeX editing environment. I would like to be able to tex the source file from within Vim, and launch an external viewing if the compile was successful. I know about the Vim-Latex suite, but, if possible, would prefer to avoid using it: it is pretty heavy-weight, hijacks a lot of my keys, and clutters up my vimruntime with a lot of files. Here is what I have now: if exists('b:tex_build_mapped') finish endif " use maparg or mapcheck to see if key is free command! -buffer -nargs=* BuildTex call BuildTex(0, <f-args>) command! -buffer -nargs=* BuildAndViewTex call BuildTex(1, <f-args>) noremap <buffer> <silent> <F9> <Esc>:call BuildTex(0)<CR> noremap <buffer> <silent> <S-F9> <Esc>:call BuildTex(1)<CR> let b:tex_build_mapped = 1 if exists('g:tex_build_loaded') finish endif let g:tex_build_loaded = 1 function! BuildTex(view_results, ...) write if filereadable("Makefile") " If Makefile is available in current working directory, run 'make' with arguments echo "(using Makefile)" let l:cmd = "!make ".join(a:000, ' ') echo l:cmd execute l:cmd if a:view_results && v:shell_error == 0 call ViewTexResults() endif else let b:tex_flavor = 'pdflatex' compiler tex make % if a:view_results && v:shell_error == 0 call ViewTexResults() endif endif endfunction function! ViewTexResults(...) if a:0 == 0 let l:target = expand("%:p:r") . ".pdf" else let l:target = a:1 endif if has('mac') execute "! open -a Preview ".l:target endif endfunction The problem is that v:shell_error is not set, even if there are compile errors. Any suggestions or insight on how to detect whether a compile was successful or not would be greatly appreciated! Thanks!

    Read the article

  • Menu items messed up while using MacVim with Vim Latex

    - by sixtyfootersdude
    I just installed macvim yesterday and I have been trying to install vim latex today. The one thing I am confused about is the menu items on the top bar: ------------------------------------------------------------------------------- <apple icon> File Edit Tools Syntax TeX-Suite TeX-Environments TeX-Elements ------------------------------------------------------------------------------- | Packages > |_____ | Templates > | 1: | | Macros > | 2: | |----------- | 3: | | Compile | 4: | | View |----- | ... | ------------- So in words if you go TeX-Suite -> Templates there is a sub menu with menu items: 1: 2: 3: 4:. Now I know that these templates live here: % pwd /Users/me/.vim/ftplugin/latex-suite/templates % ls IEEEtran.tex article.tex report.tex report_two_column.tex and they are named correctly. Also I know that the :TTemplate vim command should do the same thing. When I type that I get this result: Choose a template file: (1) IEEEtran (2) article (3) report (4) report_two_column Enter number or name of file : So I am thinking that this must be a bug in MacVim. Is this a reasonable assumption? Any fixes?

    Read the article

  • Vim script to TeX source, and launch PDF only if no errors

    - by Jeet
    Hi, I am switching to using Vim for for my LaTeX editing environment. I would like to be able to tex the source file from within Vim, and launch an external viewing if the compile was successful. I know about the Vim-Latex suite, but, if possible, would prefer to avoid using it: it is pretty heavy-weight, hijacks a lot of my keys, and clutters up my vimruntime with a lot of files. Here is what I have now: if exists('b:tex_build_mapped') finish endif " use maparg or mapcheck to see if key is free command! -buffer -nargs=* BuildTex call BuildTex(0, <f-args>) command! -buffer -nargs=* BuildAndViewTex call BuildTex(1, <f-args>) noremap <buffer> <silent> <F9> <Esc>:call BuildTex(0)<CR> noremap <buffer> <silent> <S-F9> <Esc>:call BuildTex(1)<CR> let b:tex_build_mapped = 1 if exists('g:tex_build_loaded') finish endif let g:tex_build_loaded = 1 function! BuildTex(view_results, ...) write if filereadable("Makefile") " If Makefile is available in current working directory, run 'make' with arguments echo "(using Makefile)" let l:cmd = "!make ".join(a:000, ' ') echo l:cmd execute l:cmd if a:view_results && v:shell_error == 0 call ViewTexResults() endif else let b:tex_flavor = 'pdflatex' compiler tex make % if a:view_results && v:shell_error == 0 call ViewTexResults() endif endif endfunction function! ViewTexResults(...) if a:0 == 0 let l:target = expand("%:p:r") . ".pdf" else let l:target = a:1 endif if has('mac') execute "! open -a Preview ".l:target endif endfunction The problem is that v:shell_error is not set, even if there are compile errors. Any suggestions or insight on how to detect whether a compile was successful or not would be greatly appreciated! Thanks!

    Read the article

  • Vim, LaTeX, and version controlI

    - by Bkkbrad
    I'm writing a LaTeX document in vim, and I have it hard wrapping at 80 characters to make reading easier. However, this causes problems with tracking changes with in version control. For example, inserting "Lorem ipsum" at the beginning of this text: 1 Dolor sit amet, consectetur adipiscing elit. Phasellus bibendum lobortis lectus 2 quis porta. Aenean vestibulum magna vel purus laoreet at molestie massa 3 suscipit. Vestibulum vestibulum, mauris nec convallis ultrices, tellus sapien 4 ullamcorper elit, dignissim consectetur justo tellus et nunc. results in: 1 Lorum ipsum dolor sit amet, consectetur adipiscing elit. Phasellus bibendum 2 lobortis lectus quis porta. Aenean vestibulum magna vel purus laoreet at 3 molestie massa suscipit. Vestibulum vestibulum, mauris nec convallis ultrices, 4 tellus sapien ullamcorper elit, dignissim consectetur justo tellus et nunc. When I review this change in git, it tells me that all the lines of the paragraph have changed because of the wrapping, even though only one semantic change has occurred. One way around this problem is to have every sentence on its own line. This looks the same in the rendered document, but the source now is harder to read, because each line has quite a different line length: 1 Lorum ipsum dolor sit amet, consectetur adipiscing elit. 2 Phasellus bibendum lobortis lectus quis porta. 3 Aenean vestibulum magna vel purus laoreet at molestie massa suscipit. 4 Vestibulum vestibulum, mauris nec convallis ultrices, tellus sapien ullamcorper elit, dignissim consectetur justo tellus et nunc. (If I soft wrap at 80, things still look bad, just in a different way.) Is it possible to have my text on disk with one newline per sentence, but display and edit it in vim as if the text of each paragraph was one long line, soft wrapped at 80 characters? I assume it requires some vim-foo rather than tweaking git or LaTeX.

    Read the article

  • Vim, LaTeX, word-wrapping, and version control

    - by Bkkbrad
    I'm writing a LaTeX document in vim, and I have it hard wrapping at 80 characters to make reading easier. However, this causes problems with tracking changes with in version control. For example, inserting "Lorem ipsum" at the beginning of this text: 1 Dolor sit amet, consectetur adipiscing elit. Phasellus bibendum lobortis lectus 2 quis porta. Aenean vestibulum magna vel purus laoreet at molestie massa 3 suscipit. Vestibulum vestibulum, mauris nec convallis ultrices, tellus sapien 4 ullamcorper elit, dignissim consectetur justo tellus et nunc. results in: 1 Lorum ipsum dolor sit amet, consectetur adipiscing elit. Phasellus bibendum 2 lobortis lectus quis porta. Aenean vestibulum magna vel purus laoreet at 3 molestie massa suscipit. Vestibulum vestibulum, mauris nec convallis ultrices, 4 tellus sapien ullamcorper elit, dignissim consectetur justo tellus et nunc. When I review this change in git, it tells me that all the lines of the paragraph have changed because of the wrapping, even though only one semantic change has occurred. One way around this problem is to have every sentence on its own line. This looks the same in the rendered document, but the source now is harder to read, because each line has quite a different line length: 1 Lorum ipsum dolor sit amet, consectetur adipiscing elit. 2 Phasellus bibendum lobortis lectus quis porta. 3 Aenean vestibulum magna vel purus laoreet at molestie massa suscipit. 4 Vestibulum vestibulum, mauris nec convallis ultrices, tellus sapien ullamcorper elit, dignissim consectetur justo tellus et nunc. (If I soft wrap at 80, things still look bad, just in a different way.) Is it possible to have my text on disk with one newline per sentence, but display and edit it in vim as if the text of each paragraph was one long line, soft wrapped at 80 characters? I assume it requires some vim-foo rather than tweaking git or LaTeX.

    Read the article

  • Vim: Making Auto-Completion Smarter

    - by Rafid K. Abdullah
    I use ctags, taglist, etc., to have auto completion in Vim. However, it is very limited compared to Visual Studio intellisense or Eclipse auto-completion. I am wondering whether it is possible to tune Vim to: Show auto-completion whenever . or - are typed. But only after some text that might be a variable (e.g. avoid showing auto completion after a number). Show function parameters when ( is typed. Stop removing the auto completion list when some delete all characters after . or -: When I enter a variable name, then press . or - to search for a certain member, I frequently have to delete all the characters I type after the . or -, but this makes Vim hide the auto completion list. I would like to keep it visible unless I press Esc. Showing related auto completion: When I type a variable and press ^X ^O, it usually shows me all the tags in the ctags file. I would like to have it showing only the tags related to the variable. Thanks for the help. EDIT: Some people are voting for this question, but no body seems to know the answer. So just wanted to mention that you don't have to provide a complete answer; partial answers to any of the mentioned points would be good also.

    Read the article

  • How to map keys in vim differently for different kinds of buffers

    - by Yogesh Arora
    The problem i am facing is that i have mapped some keys and mouse events for seraching in vim while editing a file. But those mappings impact the functionality if the quickfix buffer. I was wondering if it is possible to map keys depending on the buffer in which they are used. EDIT - I am adding more info for this question Let us consider a scenario. I want to map <C-F4> to close a buffer/window. Now this behavior could depend on a number of things. If i am editing a buffer it should just close that buffer without changing the layout of the windows. I am using buffkil plugin for this. It does not depend on extension of file but on the type of buffer. I saw in vim documentation that there are unlisted and listed buffer. So if it is listed buffer it should close using bufkill commands. If it is not a listed buffer it should use <c-w>c command to close buffer and changing the window layout. I am new at writing vim functions/scripts, can someone help me getting started on this

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >