Tag Info

New answers tagged

1

One options is to use: if system("uname") == "Linux" set filetype off match ExtraWhitespace /\s\+$/ endif


2

Start just above the first function and jump to the opening brace with ]M. You can now jump to the next one with ]}]M (]} = closing brace, then ]M again), which is a bit long-winded, so map that to an f-key: :nmap <F9> ]}]M If you use "goldilocks" style indenting, e.g.: void foo (int bar) { This takes you to the same line as the signature -- ...


0

This error happens when vim is invoked and it's connected to the previous pipeline's output, instead of the terminal and it's receiving different unexpected input (like NULs). The same happens when you run: vim < /dev/null, so reset command in this case helps. This is explained well by grawity at superuser. On Unix/OSX you can use xargs with -o ...


0

Apart of vim -, you can also use process substitution using the <(command) syntax, in example: vim <(echo This is example.) vim <(cat /etc/hosts) See also: How to edit files non-interactively (e.g. in pipeline)? at Vi SE


2

Alternatives Unless you really need special Vim capabilities, you're probably better off using non-interactive tools like sed, awk, or Perl / Python / Ruby / your favorite scripting language here. That said, you can use Vim non-interactively: Silent Batch Mode For very simple text processing (i.e. using Vim like an enhanced 'sed' or 'awk', maybe just ...


1

automatic edition should be done using sed(1) (see man sed ) The commend your are looking for are sed -i -e s/old/new/g -e /deletethis/d -e '/^$/d' postgresdb.out I am not sure what you expect with :%s/\n\n//d. where -i means edit in place (usually sed will output edition do standard output) -e ... do the edition/deletion -e '/^$/d' shoudl delete ...


0

Most systems at this point use a symlink of vi to the vim program. Calling the program in this manner enables some functionality and disables other modes of operation. More to the point, you note that you're wanting to utilize the paste functions in vi. I'm going to make the assumption that you're using vi on Mac OSX in the terminal program. To utilize the ...


1

From your description I suspect you're looking for enabling Paste mode in Vim. You may do this as follows: :set paste It can be disabled with :set nopaste This mode is useful when you copy-paste some code snippet from your OS buffer to Vim. This will prevent Vim from adding lots of extra spaces to line beginnings making pasted text look ugly.


3

There's a couple of things that keep me from saying definitively what the reason is: first I don't know if you're using vim, vile, nvi or heirloom vi. The second thing I don't know is how you closed vi, but I'll give a guess. As far as I know, all vi programs use escape sequences to control what appears on the screen. That is, instead of using windowing ...


0

alias vi='echo "vi not allowed (Ok, ok, if you are a vi fanatic: /usr/bin/vim)"'


0

Usually (always?) vi is simply a link to vim. On my system (OpenSuSE), /bin/vi is just a symbolic link to /bin/vim. So if you just remove both of those, it should be gone. But as others have asked, why on earth would you want to do that?


3

You can test where /usr/bin/vi to lead update-alternatives --query vi Usually there is link to /usr/bin/vim.tiny To find package name you can try dpkg -S /usr/bin/vim.tiny In my system I have received vim-tiny: /usr/bin/vim.tiny So there is additional package vim-tiny.



Top 50 recent answers are included