vim (Vi IMproved) is a text editor supporting different editing modes.
1
vote
2answers
25 views
How can I set “vi” as my default editor in UNIX?
I believe I can do something like export EDITOR=vi, but I'm not sure what exactly to enter, and where.
How can I set "vi" as my default editor?
1
vote
1answer
32 views
VIM: Display Hex Code Inline
I would like to have hex codes been displayed inline, no matter what filetype is activated in the current session.
So far I've found something existent and suitable for my needs: ...
3
votes
1answer
56 views
vi[m] read range of lines from another file
On Linux, editing file_B in vim I want to add line 10-25 from file_A. Example: One has a whole set of HTML-Documents with quite the same header and yes, one could create a template and start from ...
0
votes
1answer
28 views
How can I hook functionality to the “go to line”-command in Vim?
I just got the idea that I wanted to make it so that Vim centered around a line when I jump to it.
Is there a way to make zz be executed automatically after I have called the colon command followed ...
1
vote
2answers
34 views
How do I set vim as the default editor when I sudo?
I'm working on a CentOS 5.9 machine, and I simply want to type
sudo vi somefile
and have my trusty vim with syntax highlighting, etc. This seems simple enough, but after many attempts, it's ...
0
votes
1answer
30 views
How do I highlight the current line and the cursor in .vimrc?
I am trying to highlight the current line as well as the cursor position in Vim. Here's my .vimrc:
set cursorline
hi CursorLine ctermbg=8 ctermfg=15 "8 = dark gray, 15 = white
hi Cursor ctermbg=15 ...
0
votes
1answer
18 views
Why is vim offering me spelling suggestions instead of using the completefunc?
I am trying to set up vim for writing email. I have a plugin to provide autocompletion of email addresses (notmuch abook ). If I do :set completefunc it tells me it is CompleteAddressBook as ...
0
votes
1answer
21 views
Comment the if statement and the matching endif keyword
In vim, I can find the matching if statement and prepend the appropriate comment symbol. (e.g. %s/.alarm./#\0/g), but then I am left with dangling endifs that I have to find manually. I could simplify ...
0
votes
0answers
21 views
Trouble with Vim Auto Commands from Learn Vimscript the Hard Way
I have been working through the examples and exercises in Steve Losh's book Learn Vimscript the Hard Way, and I have hit some serious trouble in chapter 12 on Auto Commands. I am running MacVim on ...
1
vote
1answer
20 views
Is it possible to affect the behavior of all vim commands in normal mode?
Is there a way to affect the behavior of all vim normal-mode commands? Say, after every command succeeds, I want to trigger some post-behavior.
2
votes
2answers
43 views
Live diff-mode editing in vim
I want a live view of diffs while I am editing a file. vimdiff is able to do something I want, like highlighting the differences between two files.
However there are two drawbacks of vimdiff that ...
2
votes
2answers
40 views
Open multiple files in Vim with a filelist
I have a file 'filelist' that contains the following lines:
text1.txt
text2.txt
text3.txt
I am looking for a command line invocation that opens the 3 files in vim. I tried the following:
$ cat ...
2
votes
4answers
58 views
Ctrl-s hang terminal emulator?
I came across a sentence in vimdoc:
Note: CTRL-S does not work on all terminals and might block
further input, use CTRL-Q to get going again.
and this key indeed hangs my vim. I was ...
2
votes
1answer
61 views
Vim - how to increase each number in visual block?
I have the following SQL:
update am.PERMISSIONS set PRM_ORDER = 35 PRM_VISIBLE = b'1' where PRM_ID = 3;
update am.PERMISSIONS set PRM_ORDER = [35] PRM_VISIBLE = b'1' where PRM_ID = 7;
update ...
1
vote
2answers
49 views
How do I set bash aliases and variables from within vim?
In cmdline mode, the following examples do not work for me.
!alias lol='echo lol'
!lol='echo lol'