Search Results

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

Page 19/76 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Vim syntax/compile-time error highlighting

    - by Tim Nordenfur
    Is there a Vim script that periodically tries to compile/interpret the code that I'm working on, and highlights syntax errors? I'd like it to point out that something is wrong between these lines: int a = 42 cout << a << endl; Such a thing would save me loads of time. I'm primarily searching for a Perl-syntax checker, but I'd also be interested in similar plugins for other languages. Update: Another error I'd like it to point out: int a == 42; cout << a << endl;

    Read the article

  • Vim: replacing start and end of a visual char, line or block

    - by gattu marrudu
    I am trying to find a shortcut to place a custom comment sequence on my code, e.g.: /* start of comment blah end of comment /**/ (it is easier to void the comment by just adding a / to the beginning) I would like to do this in Vim by selecting a visual line, block or char and adding '/' characters at the beginning of the block and '/*/' at the end, plus newlines. After selecting some lines (Shift-V) I tried this: '<,'>s/\(.*\)/\/*\r\1\r\/**\// But it adds the comment chars at EACH newline. How can I only apply the substitution at the beginning and end of the selected range? Thanks gm

    Read the article

  • How-to handle errors in Vim Script ?

    - by ereOn
    In my .vimrc file, I have the following function, which folds the licensing information on the top of some .hpp and .cpp files: " Skip license function! FoldLicense() if !exists("b:foldedLicense") let b:foldedLicense = 1 1;/\*\//fold endif endfunction au BufRead *.hpp call FoldLicense() au BufRead *.cpp call FoldLicense() This works well, but if I open a .cpp file which doesn't have any licensing information block, Vim complains that the pattern is not found. Fair enough, but is there a way so that he stops complaining and just does nothing if the pattern is not found ? Thanks !

    Read the article

  • Clear all currently defined vim macros

    - by Simon Walker
    Hi everyone I have a vim macro that I keep mistyping, usually when I'm trying to save something so I do it quickly and I can't work out what keys I pressed. It is annoying as it pastes some irrelevant bash code into my file so I have to undo the erroneous pasting which also undos the last thing I typed that I do want. I was looking for a way to either list the currently defined macros (so I can redefine the offending one), or a way to clear out them completely. I only use macros in the very short term so I don't mind losing them all. Cheers

    Read the article

  • Vim configuration, setting up autocomplete, and columns

    - by Yktula
    How do I set up auto-completion for C? I've heard it's language agnostic. How does this work? Where can I find a list of settings available for vim? I often find that code is usually occupying the left side of my screen when editing. How can I have the next "page" or so of code displayed on the right side, treating the column on the right side as just an extension what's on the left side, with the two scrolling together nicely?

    Read the article

  • Word Wrap in Vim (preserving indentation)

    - by sixtyfootersdude
    I was just looking at this post which describes how to wrap entire words in vim. The accepted solution was this: :set formatoptions=l :set lbr Which takes this text (tabs are shown as \t): *Inside of window *Outside of window |---------------------------------------| |\t\tthis is a like of text that will wr|ap here |\t\tcan you see the wrap | | | |---------------------------------------| This accomplishes a behavior like this (tabs are shown as \t): *Inside of window *Outside of window |---------------------------------------| |\t\tthis is a like of text that will | |wrap here | |\t\tcan you see the wrap | | | |---------------------------------------| I would however like to redefine this function. I would like the wrapped line to have the same number of tabs in front of it that the line above has plus one. Ie: *Inside of window *Outside of window |---------------------------------------| |\t\tthis is a like of text that will | |\t\t\twrap here | |\t\tcan you see the wrap | | | |---------------------------------------| Any ideas?

    Read the article

  • Becoming better at Vim

    - by Autopulated
    I've been using Vim for quite a long time, but I'm at a level where I use insert mode most of the time, and I still use the arrow keys to move around(!). I feel like I'm not getting the best out of my lovely editor, particularly regarding navigating (especially code), copy & pasting, and doing other manipulations of existing code. (though I am quite comfortable with complicated search/replace patterns). How should I go about learning more? What resources would people recommend?

    Read the article

  • How to tell Vim to extend the background color to the whole screen?

    - by chiborg
    I have an issue with the Vim color schemes: The background color does not fill the whole screen. For example, in the "blue" color scheme the whole screen should turn blue. Instead, the blue background only extends to the end of each line. Is this a setting in the console I'm missing or is this an issue with my vim default settings? I'm only having this issue with Ubuntu 10.10. echo $TERM outputs xterm-color. [Update]: To eliminate error sources my minimal ~/.vimrc looks like this: filetype plugin on colorscheme blue syntax on /etc/vim/vimrc contains the unchanged defaults of Ubuntu

    Read the article

  • Vim: How to install plugin for a particular filetype?

    - by ronnie
    Yesterday I came across jedi-vim plugin which provides auto-completion for python. I installed the plugin using pathogen by placing it in bundle directory and it is working fine. Now, as I have mentioned that this plugin is only for filetype: python so I want to load it only when I open files with .py extensions and not when I open other files like .java, .perl, .sh. So, how can this be achieved. I am a vim beginner/noob but I googled before asking and found that this can be achieved using vim ftplugin but I have no idea whatsoever where to place which file.

    Read the article

  • In vim, prevent caret moving back when I leave edit mode?

    - by romkyns
    In vim, if I enter and leave edit mode without doing anything, the caret ends up one character to the left. And if I enter and leave append mode, the caret moves forwards and then backwards. Any way to configure vim to leave the caret alone in these cases? Ideally I just want to always enter append mode, but without moving the caret when I enter or exit the mode. (Currently I usually use insert mode because it doesn't mess up my caret position upon entry. That is, except when I need to append to the end of the line, in which case I swear at vim for behaving in such an archaic fashion, press Esc and enter append mode.)

    Read the article

  • is there a way to have VIM do incremental search on text files?

    - by Alex
    Is there a way to have VIM do incremental search on text files? Vim already does incremental search within the currently open file. Examples of programs that demonstrate the type of search I'm trying to accomplish are Notational Velocity for MacOS, Resop for windows or SimpleNote for the web. These apps do an instant or incremental search in the files of a specific directory and make it easy/fast to narrow down the file you are looking for or create a new file. I use both but would rather live in one editor.(that being VIM) Is there some plug in that would do this?

    Read the article

  • How do you do incremental search across multiple text files in VIM?

    - by Alex
    Is there a way to have VIM do incremental search on text files? Vim already does incremental search within the currently open file. Examples of programs that demonstrate the type of search I'm trying to accomplish are Notational Velocity for MacOS, Resop for windows or SimpleNote for the web. These apps do an instant or incremental search in the files of a specific directory and make it easy/fast to narrow down the file you are looking for or create a new file. I use both but would rather live in one editor.(that being VIM) Is there some plug in that would do this?

    Read the article

  • What's the easiest way to delete Vim swapfiles I've already recovered from?

    - by Peeja
    Sometimes Vim crashes and leaves me a swapfile. That's awesome. Then I open the file I was editing and Vim asks me if I want to recover. I do, thanks. When it's done, Vim tells me, You may want to delete the .swp file now. Why, yes, I do. How do I do that? I figured it would just start using the old swapfile as a swapfile again and clean it up when I quit, but that's not true. It makes a new one, cleans that one up, and when I open the file again it prompts me again to recover from the first one. Surely I'm missing something.

    Read the article

  • Are there any Spreadsheet apps that are as easy and powerful to use as Vim?

    - by ovatsug25
    I'd like to use a spreadsheet that lets me move around cells like I do in Vim. As well, the more commands that are attributed to keyboard shortcuts, the better. Particularly stuff like making Text-to-Columns which is one of my more frequently used features in Excel. I don't mind learning the shortcuts if they allow me to just look at the spreadsheet page and forget about everything else. edit: The way I am thinking about the Spreadsheet right now is as if every cell is its own unique file. There should be a command where I choose to open that file and edit it right on the spot within the view of the spreadsheet. So I guess I want different modes like in vim which have commands and there should be one mode that is hooked up just to do operations or formatting which would be similar to command mode in Vim.

    Read the article

  • Vim: How can I :cd to an sftp directory?

    - by ChrisInCambo
    Hi, I'm currently an emacs user, but thought I would come back and take another look at Vim for fun. My client machine is Ubuntu, and I frequently work on other ubuntu servers within my network, emacs and tramp is really nice in this regard, I can just connect to a file via sftp and then easily navigate to it's parents/children/sibling, just as if I was dealing with a file on the local file system. With Vim I can sftp to a file, but none of the navigation stuff works, when I use :e or fuzzy file search, vim still thinks I'm back on the client machine. If I try to :cd to the sftp directory I get an error. Is there anyway I can get the same file/folder navigation regardless of whether I'm looking at an sftp folder or a folder on my client machine? Cheers, Chrsi

    Read the article

  • How to Get Vim to do Filename Completion Even When You are Root

    - by user12608033
    From the Obscure Unix Admin Tip of the Day section... If you occasionally edit files as root (I never do, I always use pfexec, wink wink), then you may have noticed that the vim (Vi Improved) editor that normally does filename completion via the <Tab> key now gives you something like: :e /etc/mo^I when you try to open up /etc/motd with a little less typing So, there are at least three solutions to this: Use <Ctrl>-E instead of <Tab> Use the "-N" flag when you start Vim :set wildchar=<Tab> (Enter those 5 characters, not an actual Tab) The reason for this? It seems that when you are root, Vim sets it's "compatible" flag, which makes it behave more like its ancestor vi. In turn this makes Vim set 'wildchar' to <Ctrl>-E. For more info, read the section you get when you enter :help cmdline-completion

    Read the article

  • Open a buffer as a vertical split in VIM

    - by alfredodeza
    If you are editing a file in VIM and then you need to open an existing buffer (e.g. from your buffer list: :buffers) how can you open it in a vertical split? I know that you already can open it with a normal split like: :sbuffer N Wehere N is the buffer number you want, however, the above opens that N buffer horizontally, not vertically. I'm also aware that you can change the window placement after opening and have a Vertical Split like so: Ctrl-W H Ctrl-W L Which will vertically split the window to the right or the left. It seems to me that if there is a sbuffer there should be a vsbuffer but that doesn't exist (not that I am aware of) Also, please note that I am not looking for a plugin to solve this question. I know about a wealth of plugins that will allow you to do this. I am sure I might be missing something that is already there. EDIT: In the best spirit of collaboration, I have created a simple Function with a Mapping if someone else stumbles across this issue and do not want to install a plugin: Function: " Vertical Split Buffer Function function VerticalSplitBuffer(buffer) execute "vert belowright sb" a:buffer endfunction Mapping: " Vertical Split Buffer Mapping command -nargs=1 Vbuffer call VerticalSplitBuffer(<f-args>) This accomplishes the task of opening a buffer in a right split, so for buffer 1, you would call it like: :Vbuffer 1

    Read the article

  • When I try to run vim in command line I get Python errors

    - by Eduan
    When I try running vim in the Terminal (so as to follow @romainl's suggestion in my other question) I get lots of Python errors, which all boil down to: IOError: invalid Python installation: unable to open /usr/include/python2.7/pyconfig.h (No such file or directory) Why is this? I can use Python or Sublime Text even, without any problems. The full list of errors is the following: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 565, in <module> File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 547, in main File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 278, in addusersitepackages File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 253, in getusersitepackages File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 243, in getuserbase File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 523, in get_config_var File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 419, in get_config_vars File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 298, in _init_posix IOError: invalid Python installation: unable to open /usr/include/python2.7/pyconfig.h (No such file or directory) Extra info: I am on Mac OS X Mountain Lion (OS 10.8) EDIT: I tried @BobDunakey idea with no success, the idea was to use sudo. I still get the same errors. EDIT 2: I was able to solve the problem thanks to Zirak's solution, which is the following: http://clearfix.be/2012/08/05/fix-mountain-lion-10-8-python-ioerror-pyconfig-h-error/

    Read the article

  • Vim: yank and replace -- the same yanked input -- multiple times, and two other questions

    - by Hassan Syed
    Now that I am using vim for everything I type, rather then just for configuring servers, I wan't to sort out the following trivialities. I tried to formulate Google search queries but the results didn't address my questions :D. Question one: How do I yank and replace multiple times ? Once I have something in the yank history (if that is what its called) and then highlight and use the 'p' char in command mode the replaced text is put at the front of the yank history; therefore subsequent replace operations do not use the the text I intended. I imagine this to be a usefull feature under certain circumstances but I do not have a need for it in my workflow. Question two: How do I type text without causing the line to ripple forward ? I use hard-tab stops to allign my code in a certain way -- e.g., FunctionNameX ( lala * land ); FunctionNameProto ( ); When I figure out what needs to go into the second function, how do I insert it without move the text up ? Question three Is there a way of having a uniform yank history across gvim instances on the same machine ? I have 1 monitors. Just wondering, atm I am using highlight + mouse middle click.

    Read the article

  • Autocommands for Matlab in vim?

    - by Benjamin Oakes
    I use several different programming languages every day, and I'd like to have different tab widths (in spaces) for each. For example: I use the "standard" 2 spaces for Ruby, but all our existing Matlab code uses 4 spaces. I have this from my personal ~/.vimrc: augroup lang_perl au! set tabstop=4 " tabstop length N in spaces set shiftwidth=4 " make >> and friends (<<, ^T, ^D) shift N, not the default 8 set expandtab " Use spaces instead of tabs augroup END augroup lang_ruby au! set tabstop=2 " tabstop length N in spaces set shiftwidth=2 " make >> and friends (<<, ^T, ^D) shift N, not the default 8 set expandtab " Use spaces instead of tabs augroup END Those work, but the following doesn't: augroup lang_matlab au! set tabstop=4 " tabstop length N in spaces set shiftwidth=4 " make >> and friends (<<, ^T, ^D) shift N, not the default 8 set expandtab " Use spaces instead of tabs augroup END I really don't understand how augroup lang_ruby figures out that I'm editing a Ruby file. (My searches brought up ftdetect, but the solution wasn't obvious.) It doesn't seem like vim knows that I'm editing Matlab using augroup lang_matlab. What do I change to make this work?

    Read the article

  • What are the preferred versions of Vim and Emacs on Mac OS X?

    - by Michiel de Mare
    For those of us that like to use the graphical version of Vim or Emacs, instead of the console version, which version do you recommend? For Vim, there's Mac OS X Vim, MacVim, Vim-Cocoa. For Emacs, CarbonEmacs, XEmacs, and Aquamacs. Are there more? Which of these are ready for prime-time? If it's a tough call, what are the trade-offs? Are all of these still being maintained? No discussion of Vim vs. Emacs, if you don't mind, or comparisons with other editors.

    Read the article

  • How do I run a vim script that alters the current buffer?

    - by Dan
    I'm trying to write a beautify.vim script that makes C-like code adhere to a standard that I can easily read. My file contains only substitution commands that all begin with %s/... However, when I try to run the script with my file open, in the manner :source beautify.vim, or :runtime beautify.vim, it runs but all the substitute commands state that their pattern wasn't found (patterns were tested by entering them manually and should work). Is there some way to make vim run the commands in the context of the current buffer? beautify.vim: " add spaces before open braces sil! :%s/\%>1c>\s\@<!{/ {/g " beautify for sil! :%s/for *( *\([^;]*\) *; *\([^;]*\) *; *\([^;]*\) *)/for (\1; \2; \3)/ " add spaces after commas sil! :%s/,\s\@!/, /g In my tests the first :s command should match (it matches when applied manually).

    Read the article

  • What are the most useful Vi/Vim Commands that you wish you'd discovered earlier?

    - by faceless1_14
    I personally learn by experimentation as opposed to reading documentation. A consequence of this is it takes me a long time to learn some of the useful features of a language like e going to the end of a word or 0 to go to the beginning of a line or $ for the end of a line as well as dd deleting a line What are some Vi/Vim commands that you find most useful but didn't know existed when you were first using Vi/Vim.

    Read the article

  • How can I keep the code formated as original source when I paste them to vim?

    - by SpawnST
    When I copy some code from webpages and paste it to VIM,I find it becomes a mess style like a ladder as follows xxxxxx xxxxxx xxxxxx xxxxxxxxxx Since it messed so regularly so I think maybe there's something wrong with my .vimrc which is as below: set number set nocompatible set nowritebackup set noswapfile syntax on filetype indent on filetype plugin on filetype on set background=light set autoindent set smartindent set tabstop=4 set shiftwidth=4 set showmatch set guioptions=T set fileencodings=utf-8,prc set ruler set incsearch map gs :%s set t_Co=256 :colorscheme evening filetype plugin indent on Usually I write python in VIM.And help would be appreciated.

    Read the article

  • Is there any way to do an emacs-like yank in vim?

    - by Jason Baker
    In emacs, yanking works something like this: if you delete something, it can be yanked back into another position. In other words, emacs's yank is sort of like cut and paste. On the other hand, it seems like vim's yank is like copy and paste: I can yank something and then paste it elsewhere, but the original text is still there. Is there any way to cut the text rather than just copying it in vim?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >