Search Results

Search found 1329 results on 54 pages for 'vim'.

Page 10/54 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • VIM autocompletion: Making ^X^U expand to longest match

    - by Sarah
    I'm using eclim to bring some eclipse functionality to VIM, however the code completion functions seem to work less than ideal. When I press ctrl+x ctrl+u after, for instance, System.out. with the curser right after the last dot, I get the completion popup-menu. This menu is really rather cumbersome to use, and the functionality that I would ideally want is something like: ctrl+x ctrl+u (expands to longest match) fill in more characters (expand to longest match). Is this possible somehow? I've tried fiddling with the completeopts settings, but they don't seem to do what I want.

    Read the article

  • Edit files from Cyberduck in an existing Vim window

    - by Eli Gundry
    I use Cyberduck as my go to FTP client on Windows. I have but one complaint, and that is whenever I click the edit button to edit the remote file with a local version of gVim, it opens in a new window/instance of Vim. This leads to a cluttered desktop as well as not allowing the AutoComplPop to work at it's full potential. What I would like to be able to do is automatically open every file in a new buffer inside of an existing gVim buffer instead of a new window, kind of like the Windows version of gVim and how it has the option to edit a file in a new buffer. Is there anyway to do this in Cyberduck/gVim setting?

    Read the article

  • bulleted lists for plain-text documents in Vim

    - by AnC
    While Vim supports automatic indenting in lists, the default setting only covers ordered lists, starting with digits: 1. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim 2. veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. I have not been able to figure out how to extend this to unordered, bulleted lists: * Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim * veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Changing the formatlistpat RegEx did not lead to the desired results (indeed, it even broke ordered lists). Any help would be appreciated!

    Read the article

  • Vim lint check - only show message if there's an error

    - by GorillaSandwich
    I have this line in my .vimrc, which means "when I save a .rb file, run it through ruby -c" (the ruby interpreter's error checking). autocmd BufWritePost *.rb !ruby -c <afile> When I save that file, I always see output at the bottom of the screen, so I get used to it and start ignoring it. What I want is to only see output if there are errors. I can see that when there are errors, after it says what they are, at the bottom, it says "shell returned 1." How can I modify this line so that it only shows a message if the shell returns 1? Is there a way to conditionally surpress output from a shell command run in vim?

    Read the article

  • include all vim files in a folder

    - by queueoverflow
    For my .bashrc I have a lot of small snippet files in .config/bash, like 10-prompt.sh and so on. In my actual .bashrc, I just have the following: configdir="$HOME/.config/bash" for file in "$configdir"/*.sh do source "$file" done I'd like to do the same for my .vimrc, but I am not that confident in VimL that I could write that. How would the snippet for .vimrc look like that includes all the snippets in a given subfolder? Ideally, I'd like to make a .vim/rc/ folder where I can put my snippets into.

    Read the article

  • Vim: I don't want to insert!!!

    - by bhh1988
    I could not find anything online addressing this problem, which is surprising. The problem is that I find it very easy to accidentally insert stuff in Vim. I know I can undo by with 'u', but it still is quite annoying and frequent. Often, I enter a command like 'sp file.txt' without realizing that I haven't entered the ':' character yet (so I'm not yet on the command line). Unfortunately, there are several characters that take you to insert mode, including 's', 'a', 'i', 'o'. I'd rather have insert mode mapped to just one keybinding which is very deliberate, like shift-space. Can anyone point me to something that might have what I'm looking for? Thanks.

    Read the article

  • vim: highlighting a search term without moving the cursor

    - by ajwood
    Using Vim, I sometimes find myself staring at a section of source code for a while and suddenly want some variable on the screen to pop out. That's easy: /<var> which highlights them all. My issue is that it more often than not the search shifts my window so I'm not looking at the source code from the same place. Even if it's only shifted a few lines, it's still throws me off since I need to take a few seconds to figure out where things have moved to. Is it possible to highlight a search term without moving the cursor to the next match?

    Read the article

  • How to columnate text with tabs (in vim or on the shell)

    - by kine
    I have a frequent need to manually manipulate tab-delimited text for data entry and other purposes, and when i do this it helps if the text is aligned properly into columns. For example (assuming 4-space tabs): # original format abcdefghijklmnop field2 abcdefgh field2 abcdefghijkl field2 # ideal format abcdefghijklmnop field2 abcdefgh field2 abcdefghijkl field2 I am very familiar with using the column utility to columnate text this way, but the problem is that it uses spaces to align the columns, and i specifically need tabs. This requirement also appears to rule out the Tabularize plug-in. Is there any way that i can columnate text with tabs specifically, either within vim or at the shell? It looks like i might be able to do it with groff/tbl, but honestly i'd rather columnate it by hand than mess with that....

    Read the article

  • Vim - select text highlighted by search?

    - by GorillaSandwich
    In vim, I often perform searches to hop to a word or phrase instead of navigating there with h/j/k/l. Then I hit n to hop between occurrences. Say I've got this text: Time flies like an arrow; fruit flies like a banana. - Groucho Marx I type /an arrow and hit enter. That phrase is highlighted, and I jump to it. Now I want to visually select that text, maybe to change it or delete it. (Yes, I'm aware of the :s substitution command.) Since my cursor is at the letter "a" at the beginning of "an arrow," I can hit v, then press e a couple of times to highlight the entire phrase. But I have a feeling there's a shorter and more semantic way. After all, I've already specified the text I'm interested in. How might I compose a command to say "visually select the current search selection?"

    Read the article

  • Misbehavior in regular expression in VIM

    - by poissonbreaker
    I am having a problem with a regular expression on vim. I have a pattern as follows: http:\/\/\(\w\+\.\?\)\+ [matches http://(AS MANY WORDS FOLLOWED BY DOT OR NOT ENCOUNTERS) e.g. http://wd1.wd2.com] I have a text as follows: http://wd1.wd2.com/wd3 I am trying to make this substitution on it: s/\(http:\/\/\)\(\w\+\.\?\)\+/\1wd4.wd5.com and the result is http://wd4.wd5.com /wd3 (Notice the white space inserted at the end of the replacement) How can I avoid having this inserted space? I am afraid is a bug in the regexp engine but I am not sure.

    Read the article

  • Puppet and Vim fighting over Ruby version

    - by devians
    I have installed puppet from the .dmg from puppetlabs. If I remove ruby 1.9.3, puppet works, but other things like my vim install (dependant plugins) do not. According to http://docs.puppetlabs.com/guides/platforms.html#ruby-versions 1.9.3 is supported. So whats going wrong with puppet? % uname -a Darwin Kusanagi.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64 % which ruby /usr/local/bin/ruby % ruby --version ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin11.4.2] % /usr/bin/ruby --version ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0] % brew info ruby 1 ? ruby: stable 1.9.3-p327, HEAD http://www.ruby-lang.org/en/ Depends on: pkg-config, readline, gdbm, libyaml /usr/local/Cellar/ruby/1.9.3-p327 (796 files, 17M) * https://github.com/mxcl/homebrew/commits/master/Library/Formula/ruby.rb ==> Options --with-tcltk Install with Tcl/Tk support --with-suffix Suffix commands with "19" --universal Build a universal binary --with-doc Install documentation ==> Caveats NOTE: By default, gem installed binaries will be placed into: /usr/local/Cellar/ruby/1.9.3-p327/bin You may want to add this to your PATH. % puppet /usr/local/Cellar/ruby/1.9.3-p327/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- puppet/util/command_line (LoadError) from /usr/local/Cellar/ruby/1.9.3-p327/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /usr/bin/puppet:3:in `<main>'

    Read the article

  • gvim configuration does not work like it should

    - by ganjan
    Hi. I have a little problem with my vim config. This what I got in my home/user/.gvimrc syntax enable "Enable syntax hl colorscheme peaksea set background=dark set gfn=Inconsolata:h11 set nonu set history=1000 set scrolloff=3 set number " turn on line numbers " Save a global session file on session close nmap SQ <ESC>:mksession! ~/.vim/session/Session.vim<CR>:wqa<CR> function! RestoreSession() if argc() == 0 "vim called without arguments execute 'source ~/.vim/session/Session.vim' end endfunction autocmd VimEnter * call RestoreSession() The colorsheme work, but the font has way to much spacing. Every sentence is twice as long. I installed the Inconsolata font and I have the same config on my windows 7 box and it works fine.

    Read the article

  • iTerm2 vim cannot map alt key

    - by Eddy
    I'm having trouble trying to map the alt-key bindings on vim in iTerm2. I want to map shortcuts for switching between buffers like this: map <A-Right> <C-w>l map <A-Left> <C-w>h map <A-Down> <C-w>j map <A-Up> <C-w>k But I can't get it to work. I've tried everything, setting the option key as "Normal", "Meta" and "+Esc" in the profile settings. I've tried <M-Right> and <T-Right> but those don't work either. There are posts on superuser and stackoverflow but they use the old version of iTerm2 (v0.x). The only things I've managed to get working are <T-up> and <T-down>, or when I just use Macvim. I'm using iTerm2 v1.0.0.20120203, and Mac OS X 10.7.5 on a Macbook Pro.

    Read the article

  • Weird rendering artefact in vim (terminal, not MacVim)

    - by Tobi Lehman
    Running Mac OS X, using either Terminal.app or iTerm2, there is a strange artefact with the character rendering that I have a hard time explaining and an even harder time understanding. I'll start with a video of my screen so that you can see and example of it in action: From the video you can see a few ways it is weird, for example, sometimes when I hit a letter in insert mode, the character is double printed. When I go into normal mode, the artefact remains. When I re-enter insert mode, hitting backspace copies the characters on the left to the position under the cursor. This has happened in OS X Lion, and Mountain Lion, under both Terminal.app and iTerm 2. This never happens under MacVim. Also, I use GNU/Linux on my other machine, and have never had this happen, I am pretty sure it is strictly a Mac OS X issue, but I do not know how to fix it. For a while, I've been working around it by using MacVim most of the time, but I prefer working in a terminal. Does anyone know what is happening here, and if so, how can I fix it? EDIT: I tried using the macvim Vim executable, and I still get strange artefacts, but they are localized to the left side of the screen, here is an example:

    Read the article

  • Vim move cursor one character in insert mode without arrow keys

    - by bolov
    This might seem a little too overboard, but I switched to vim and I so happy about the workflow now. I try to discipline myself not to use the arrow keys, as keeping the hands on the alfa-keys all the time is such a big thing when writing. So when I need to navigate I get out of insert mode, move in normal mode and get back in insert mode. There is an exception where this is actually more disrupting: I use clang complete with snippets and super tab which is great. Except every time I get a function auto completed after I fill in the parameters I am left with the cursor before ) so to continue I have to move the cursor one character to the right. As you can imagine this happens very often. The only options I have (as far as I know) are : Escla or ?, and I am not happy about neither of them. The first one makes me hit 3 keys for just a simple 1 character cursor move, the second one makes me move my hand to the arrow keys. A third option would be to map CTRL-L or smth to ?. So what is the best way of doing this? //snippets (clang complete + supertab): foo($`param1`, $`param2`) //after completion: foo(var1, var2|) ^ ^ | | I am here | Need to be here | denotes cursor position

    Read the article

  • Indentation annoyance with CSS in Vim

    - by Johan Sahlén
    I've moved from TextMate to Vim lately, and am really liking the switch. However, I have an itch regarding the way Vim handles indentation within curly braces using the CSS syntax. I use simple_pairs.vim, which may or may not have something to do with my problem, but I don't think so, as things work fine in PHP, JavaScript, etc. Let me explain… I generally group my CSS rules by context using indentation, like so: ul#nav { margin: 10px; } ul#nav li { float: left; margin-right: 4px; } That means when I type my ul#nav li rule, followed by { (which inserts a corresponding } automatically) and hit enter, I want the closing brace to be at the same indentation level as the ul#…, but instead I get something like this: ul#nav { margin: 10px; } ul#nav li { } So I have to indent the extra step(s) manually. Like I said, doing the same thing in PHP, JavaScript, etc, works fine. Does anyone know how I can fix this? I don't understand enough of Vim's syntax definition files for me to be able to figure out what in the PHP syntax file makes it work, and port it over to the CSS one… Thanks.

    Read the article

  • _Painless_ integration of Eclipse with Vim?

    - by Adnan
    Hi, Has anyone managed to get Vim integrated into Eclipse painlessly? I just want to use Vim for the editor while retaining the general Eclipse interface. I have tried using Eclim plugin but the editor seemed to crash more often than work (the site said that the editor replacement functionality is still beta). On the flip side, is there any IDE which matches Eclipse's functionality -- mainly the integration with SVN, ant, etc. -- and is also able to use Vim? I mostly use eclipse for SAS SCL, Java and Javascript programming and find the eclipse editor too "mouse-y". I'd also like, in a perfect world, to use vimdiff as a diff viewer for SVN (we use TortoiseSVN) while checking for diffs or conflicts during merge etc. I admit I havent spent a lot of time trying to get these things to work. I feel guilty about spending too much time on potential wild-goose-chases while my other team members are working away at their code, perfectly content with all that eclipse has to offer. Edit: Just found this while desperately browsing around: Vim plugin.. Any experience using this? Its saturday afternoon in Kiwi land, so I'll try it later and update if no one has an opinion. From the claims on the site, it sounds perfect.

    Read the article

  • Making Vim auto-indent PHP/HTML using alternative syntax

    - by njbair
    I edit PHP in Vim and have enjoyed the auto-indenting, but PHP's alternative syntax doesn't auto-indent how I would like. For instance, in an HTML template, Vim doesn't recognize the open control structure in the same way it does when using braces. Example: <html> <body> <p> <?php if (1==1): ?> This line should be indented. <?php endif; ?> </p> </body> </html> I want Vim to recognize the open control structure and indent the HTML within it. Another example which uses pure PHP: <?php if (1==1): echo "This line gets indented"; echo "This one doesn't"; endif; ?> The indentation is terminated by the semicolon, even though the control structure is still open. Does anybody know how to get Vim to work in these situations? Thanks.

    Read the article

  • Vim: change formatting of variables in a script

    - by sixtyfootersdude
    I am using vim to edit a shell script (did not use the right coding standard). I need to change all of my variables from camel-hum-notation startTime to caps-and-underscore-notation START_TIME. I do not want to change the way method names are represented. I was thinking one way to do this would be to write a function and map it to a key. The function could do something like generating this on the command line: s/<word under cursor>/<leave cursor here to type what to replace with> I think that this function could be applyable to other situations which would be handy. Two questions: Question 1: How would I go about creating that function. I have created functions in vim before the biggest thing I am clueless about is how to capture movement. Ie if you press dw in vim it will delete the rest of a word. How do you capture that? Also can you leave an uncompleted command on the vim command line? Question 2: Got a better solution for me? How would you approach this task?

    Read the article

  • How to Detect that Current (Bash) Shell is a (Vi/Vim) Subshell?

    - by Jeet
    From inside Vi/Vim, I can type: :shell to drop into a shell. Is there any way to detect that I am in a Vi-spawned subshell? The environmental variable SHLVL is 2, but that does not tell me explicitly that I am in a Vi/Vim-spawned subshell. On OS X, the following variables are also set: MYVIMRC, VIMRUNTIME, VIM. How universal are these? Can I count on these being set in any system, if and only if I am in a Vi/Vim subshell? If not, is there any portable, robust and hopefully efficient way to tell that I am in a Vi/Vim subshell? Thanks.

    Read the article

  • Can I copy from vim to another window without +xterm-clipboard?

    - by GorillaSandwich
    I'm using Ubuntu and vim. I can copy text from vim and paste it into another window by highlighting it in vim, then middle-clicking in the other window. This works fine when I'm on my local machine. I can also copy into the system register by highlighting text and yanking to the system register. (For example, Shift-V JJ "+ y to go into linewise visual mode, highlight two lines, select the '+' register and yank.) It's then available to paste into other windows. However, if I ssh into my web host, I can't do either of these. (They use some flavor of Linux - I think it's CentOS.) In vim, if I type :version, my local version shows +xterm_clipboard, but the host's version shows -xterm_clipboard. I don't have sudo rights there. Is there any way to be able to copy from their vim without getting them to tinker with the installation?

    Read the article

  • how to temporarily set makeprg in vim

    - by Haiyuan Zhang
    In the normal case I use vim's make utility I will set makeprg to the Makefile of the project I'm currently working for. Since usually the project will last for weeks or even longer, I don't need to change the setting of makeprg very often . But sometimes I need to write some "foobar" code either for practicing my c++ skill or for prototyping some primitive ideas in my mind. So whenever I switch to the "foobar" mode of vim usage, I need to comments the original makeprg setting add the new setting as following : au FileType c set makeprg=gcc\ % au FileType cpp set makeprg=g++\ % which is really very very inconvenient . when I back to the "normal project mode" of vim usage, I need to change back to the original setting . back and forth .... what I want to know from you guys is that : is it possible to make the setting of makeprg temporarily . for example , define a function in which first set a local value of makeprg and then call make before return form the function call automatically restore makeprg to the value before the function call.

    Read the article

  • vim filters and stdout/stderr

    - by ahe
    When I use :%! to run the contents of a file through a filter and the filter fails (it returns another code than 0) and prints an error message to stderr I get my file replaced with this error message. Is there a way to tell vim to skip the filtering if the filter returns an status code that indicates an error and/or ignore output the filter program writes to stderr? There are cases where you want your file to replaced with the output of the filter but most often this behavior is wrong. Of course I can just undo the filtering with one keypress but it isn't optimal. Also I have a similar problem when writing a custom vim script to do the filtering. I have a script that calls a filter program with system() and replaces the file in the buffer with its output but there doesn't seem to be a way to detect if the lines returned by system() where written to stdout or to stderr. Is there a way to tell them apart in vim script?

    Read the article

  • vim command to restructure/force text to 80 columns

    - by wickedchicken
    I know there are ways to automatically set the width of text in vim using set textwidth (like http://stackoverflow.com/questions/235439/vim-80-column-layout-concerns). What I am looking for is something similar to = (the indent line command) but to wrap to 80. The use case is sometimes you edit text with textwidth and after joining lines or deleting/adding text it comes out poorly wrapped. Ideally, this command would completely reorganize the lines I select and chop off long lines while adding to short ones. An example: long line is long! short After running the command (assuming the wrap was 13 cols): long line is long! short If this isn't possible with a true vim command, perhaps there is a command-line program which does this that I can pipe the input to?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >