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 ...
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 ...
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 ...
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 ...
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. ...
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 ...
2
votes
Accepted
Vim Looks Very Weird When Using chcp 65001
Fixed by adding set encoding=utf-8 to .vimrc (called _vimrc on Windows).
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 ...
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 ...
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 ...
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 (...
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 ...
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 ...
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 ...
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.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cygwin × 27vimrc × 5
microsoft-windows × 5
neovim × 2
gvim × 2
terminal × 2
colorscheme × 2
plugin-you-complete-me × 2
font × 2
encoding × 2
x11 × 2
regular-expression × 1
external-command × 1
plugin-system × 1
comments × 1
scrolling × 1
os-clipboard × 1
shell × 1
global-command × 1
unicode × 1
plugin-airline × 1
tmux × 1
original-vim × 1
line-breaks × 1
mouse × 1