learn vim

Divesh Dutt

New Member
Joined
Aug 18, 2018
Messages
13
Reaction score
6
Credits
0
Hi i am new to linux and i want to learn vim to code because i am from embedded background how could i do that and how can i learn low level drivers programming in linux?
 


Best way to learn vim is to look up an article on it with some basics, then try to use it as much as you can. The more you use it, the easier it'll get. Before you know it, you'll be hitting ESC in web forms by accident when you're done typing! :)

Check out https://www.linux.org/threads/using-vi-vim.4139/

Rob
 
In one word:
vimtutor

vimtutor is a tutorial that is installed alongside vim.
If you open a terminal and run vimtutor - you can learn some basic vim usage.

There is also the vim wikia site which is packed with all kinds of hints and tips:
http://vim.wikia.com/wiki/Vim_Tips_Wiki

There are vim tutorials posted all over the internet.
There are also some really good vim related books/ebooks available out there too:

Apress's book "Pro Vim" by Mark McDonnell is a complete tutorial that will take you from the basics right through to advanced usage of vim.

For customizing vim to suit your needs - check out Packt Publishing's book "Hacking Vim 7.2" by Kim Schulz. The book is quite old now - released in 2010, but it's still relevant. It has some great tips for customising vim.

Vim is extremely configurable, this book contains a bunch of tips/tricks that will allow you to change the look/feel of vim and add keybinds to allow you to quickly and easily perform common tasks.

My personal favourite is The Pragmatic Bookshelf's book "Practical Vim - Edit Text at the Speed of Thought" By Drew Neil. I own the first edition, but there is an updated 2nd edition available.

Many books start out with a gentle introduction to vim, how to install vim etc.
This book does none of that - it just gets straight to the good stuff and deals purely with the functionality in vim. As long as you have spent some time with vimtutor and got used to basic vim usage - you'll get on really well with this book. It explains and demonstrates some of the more powerful, productive features of vim which in turn will make you much more productive when using vim.

Finally - as a developer who uses vim in the terminal a lot - another book that I also found useful is Pragmatic Bookshelf's "Tmux - Productive Mouse-Free Development" by Brian P. Hogan.
This book is a complete guide to tmux - a terminal multiplexer that allows you to run and manage several terminal sessions and even multiple tmux sessions from within a single terminal window. You can split the screen horizontally, or vertically into multiple panes, or add new 'Windows' ('windows' in tmux are more akin to tabs) and switch between them.
You can also resize panes, re-order them, give them different layouts, move them to other 'windows'/tabs. And if you have multiple panes on screen and you need more space in the pane you are working in, you can maximise the current pane to fill the entire work-space. The other panes will still be there, they are just hidden!

Everything in tmux is controlled via keyboard shortcuts, so once you've learnt how to use it, you can be really productive - your hands literally never have to leave the keyboard!

Running vim in the terminal inside a tmux session allows me to be able to set up an IDE-like environment inside a single terminal emulator window. So I can have one pane for editing in vim, another pane for running build-scripts or the debugger. Sometimes when debugging I'll add code that writes information to a log-file. So sometimes I'll add a 3rd pane that watches a log-file using tail:
Code:
tail -f /path/to/logfile
Then I can see information that is logged by the program I'm debugging in real-time.

So if you're a developer and you use the terminal a lot: tmux + vim is awesome!
 
Last edited:

Members online


Top