Reputation: 27885
I have a few text files, each for its own purposes. (Like: download.txt, questions.txt, word-meaning.txt etc.)
questions.txt
:
I put all my question, doubt approaching in my mind to this file to ask/clear when I go online (I've no access to internet everytime of the day). I delete that line from the file when I ask that question.
download.txt
:
I keep names of all packages or zipballs or tarballs in this file and download when I am connected.
word-meaning.txt
:
I am not a native English speaker, so whenever I see any word which's meaning I don't in my native language, I write that down in this file and use Google Translate to translate it to my native language when I am connected.
In all above cases I have to go to last line of the file everytime I have to add anything to those lists.
Can I make vim go to line line, last character of the file and then go in in insert mode? I will alias that to something like vimll
to use it with these type of files.
Similar Question:
Upvotes: 2
Views: 1558
Reputation: 27885
You can do this in terminal:
vim filename.ext +$ +starti!
To go to the last line, last character of the file filename.ext
and then in insert mode.
You can also alias that for your convenience of use, so add the following in your .bash_aliases
file:
alias vimll='vim +$ +starti!'
Upvotes: 1
Reputation: 172698
You can define an autocmd to go into insert mode at the end of the file whenever one of your files is loaded into a Vim window:
autocmd BufWinEnter questions.txt,download.txt,word-meaning.txt $|startinsert!
Upvotes: 2