Hot answers tagged

6 votes

How do I pick a line and write it to an external file?

You can use :[range]w >> file to append the given range to the given file. If the file does not yet exist, use the ! argument to the :w command to force writing the new file. So this means you ...
Christian Brabandt's user avatar
6 votes

Can't Move to End of Line With Vim on Cygwin

Vim's cursor is always on a character position, never between character positions, even though some cursor shapes make it appear that the cursor is between character positions. When your cursor ...
garyjohn's user avatar
  • 6,284
3 votes
Accepted

Explanation of command :'<, '>

Surprisingly, better than Google is to search in Vim's builtin help. :h '< '< `< To the first line or character of the last selected Visual area in the current buffer. For block ...
grodzik's user avatar
  • 4,518
3 votes
Accepted

Why syncolor.vim is sourced at the end of cygwin vim started and replaced the specifed colorscheme

There's a simpler workaround. Just add let g:syntax_cmd = "skip" to your .vimrc. From :h syntax_cmd: The "syntax_cmd" variable is set to one of these values when the syntax/syncolor.vim files are ...
Ray's user avatar
  • 216
2 votes

Why syncolor.vim is sourced at the end of cygwin vim started and replaced the specifed colorscheme

Okay, Okay, I found the reason. There's code shows in /usr/share/vim/vim74/syntax/synload.vim: $ cat -n /usr/share/vim/vim74/syntax/synload.vim ... 17 " Set the default highlighting colors. ...
Marslo's user avatar
  • 133
2 votes
Accepted

Using the same plugin folders for gvim and with vim in cygwin

There are several different types of symlinks on Cygwin. Only the native NTFS symlink type will be understood by a non-Cygwin build of gVim. That gives you two options, depending on which direction ...
Warren Young's user avatar
2 votes
Accepted

Vim Looks Very Weird When Using chcp 65001

Fixed by adding set encoding=utf-8 to .vimrc (called _vimrc on Windows).
Gnosis's user avatar
  • 21
2 votes
Accepted

Using the execute shell command (:!) on Windows and MSYS2

The comments by B layer and Ben Knoble were both helpful in finding the answer. Vim correctly set the shell based on the $SHELL variable, but did not set shellcmdflag appropriately, and that was what ...
Bodhi Daruma's user avatar
1 vote
Accepted

Why does this pattern make :global work only on the first line of the highligted match?

I believe this is because the :g command doesn't operate on your search pattern directly, but rather on the line that the search pattern starts on. According the help (:help :g), the way the :g ...
Pak's user avatar
  • 1,092
1 vote

Windows context menu "open with vim" symlink error

Found a solution/hack: If you set a Windows %HOME% environment variable to a path for a folder that contains _vimrc things will work. Experiments with MYVIMRC, MYGVIMRC, and VIM environment ...
kmarx's user avatar
  • 21
1 vote
Accepted

Why is this particular keystroke (shown inline) highlighted in VIM version 8.0 under Cygwin, and how to remove it?

As determined in the comments, ]; formed the last search pattern (as set by :global, :substitute, /, or ?—cf. :help quote_/), and 'hlsearch' was set. Therefore, the characters were highlighted (...
D. Ben Knoble's user avatar
  • 25.3k
1 vote
Accepted

Why Backspace key do not work in insert mode in shell file by default in Cygwin?

Backwards compatibility (with vi, and also with earlier Vim releases) is a big thing in Vim. However, there have been many complaints like yours in the past, so Vim 8.0 introduced a :help defaults.vim ...
Ingo Karkat's user avatar
  • 17.7k
1 vote
Accepted

Scroll wheel inserts seemingly-random characters in cygwin vim, depending on where on the screen the mouse cursor is

Try this: :set nolazyredraw I was looking at your config and that setting caught my eye. The default is false but you have it enabled. When I enable it in my Cygwin environment and then use the ...
B Layer's user avatar
  • 19.5k
1 vote

Explanation of command :'<, '>

'<,'> is not a command, but a range. You can prefix any command with a range. If you want to know more: :h ranges. '<,'> is always displayed, when you select with visual mode and it ...
mike's user avatar
  • 939
1 vote

Getting Error while opening files through vim

Though Cygwin is installed in Windows, it resembles linux. So, setting the fileformat to unix solves the problem. :set fileformat=unix Now, the unicode characters are accepted by Cygwin.
SibiCoder's user avatar
  • 3,302

Only top scored, non community-wiki answers of a minimum length are eligible