• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[How-to] Stop using Notepad++ and use vim!

Fallen

Freelancer
Senator
Joined
Aug 21, 2009
Messages
3,712
Reaction score
249
Location
Egypt
Hi there, this is yet another how to tutorial that I wrote when bored again...
After reading this, you will be able to:
1. Use vim like a boss.
2. Stop using shit windows text editors.
3. Use Linux correctly like a G6.
5. Multitask like a pro, edit over 9000 files at the same time without much effort like in Notepad++.

Things to consider before diving in:
vim is "hard" but it's features are endless.

Download what you will need:
1. Install vim:
For Debian based users:
$ sudo apt-get install vim
Arch Linux users:
$ sudo pacman -S vim
Windows users can download a binary from Vim's download page: http://www.vim.org/download.php
2. Configure vim
3. Install git
Debian-based users:
$ sudo apt-get install git-core
Arch Linux users:
$ sudo pacman -S git
Windows users can download a binary from Git's website: http://git-scm.com/download/win
2. Install some useful vim plugins that will save you some time writing config files etc.
- Option 1, use a minimal one:
Code:
git clone https://github.com/scrooloose/vimfiles.git ~/.vim
cd ~/.vim && git submodule init && git submodule update
ln -s ~/.vim/vimrc ~/.vimrc
- Option 2, use a more advanced one:
WARNING: This one may be "bloated" as it may contain stuff you might not find useful. See also https://github.com/edubart/vimfiles for more information on stuff included.
Code:
git clone https://github.com/edubart/vimfiles.git ~/.vim
cd .vim && git submodule init && git submodule update
ln -s ~/.vim/vimrc ~/.vimrc

Frequently used vim commands are:
1. ESC (command mode)
2. i (shortcut for INSERT)
3. :vsplit :split (Can only be used in command mode)
4. v (command mode - select text)
5. y (Yank selected text "copy it") - NOTE: This doesn't not copy to the X clipboard but the middle mouse button clipboard.
6. p (Paste text) - NOTE: this doesn't paste from clipboard. To paste from clipboard, use the middle mouse button.
7. u (undo last action) - This is infinite, you can undo as much as you want.
8. dd (cut current line, see also 6.)
9. :w (saves current file)
10. :q (quit vim)
- :q! (quit without saving changes)
- :wq (save & quit)
11. /<text> (searches for <text> in the current file).
12. :%s/<text>/<replacement>/ (searches for <text> and replaces with <replacement>).

Now, we can start.
I'll be using ~/vi_tut/ for the files i'm going to create with vim and edit.
$ cd ~/vi_tut
$ vim tut1.c
Which should hopefully, show something like this:
cLDrE.png

Now press i to go for INSERT mode, which should enable you to edit the file.
Xst9l.png

Now, you should write stuff in the file:
HvsDu.png

Save it:
1. first go command mode (press ESC)
2. type ":w" then enter.
Which should hopefully, show up something like so:
qn0Uf.png


So now, you've learned how to create a new file etc. how to for example, compile the code when you're in vim?
simply go to the command mode (press ESC) and type:
:make tut1
Should output:
cc tut1.c -o tut1

Simple process isn't it? Now it's time to learn some epic multitasking.
Open some file or a directory. In my case I'll open a whole directory then open files from there.
$ vim vi_tut/
dlvDR.png

Enter command mode and type ":split <filename>" or "vsplit" any work:
j9v1j.png

BZSCx.png

If you're done with a file and want to close it, first make sure it's the selected one, i.e select some text in it using your mouse, then safely type ":q" or whatever, see FAQ #10.

Where to go from here?
Vim Tips Wiki best place to learn more about vim.
The Vim commands cheat sheet is a good table for vim commands and is straight forward.

Questions, feedback, etc... are always welcome.
 
Last edited:
Ahh shit! You're calling me out?!?!

Notepad++ is the only reason I stay so good at compiling Wine. That and I've done some mad sauce-edits to support 7-wordlists for mad pretty colors wit da syntax lexing.

vim... That's fucking eldritch. Like God took a walk and left you alone in his house, while his gun cabinet is unlocked. I really should have gotten more skilled with it by now, but I use fucking CarpalX:
qgmlwy.png

So I don't have to answer to your challenge! I've got mad Elite cred, QGMLWY > Colemak > Dvorak > Qwerty.

For those who don't have legitimate reasons to remain tied to Notepad++, Sublime Text has really made quite an impression on a lot of scrutinizing devs, the kind who spend hours each day in their editor. However, it's not as well suited for serious engineering in Lua as some other choices, but for doing your web/php stuff it's got some dead serious extensions.

The seems the most badass thing to have cropped up lately: ZeroBrane. I'm not even going to describe it.


But yeah. I will state this here and now. I am ashamed I'm not more skilled with vim. It is thee most powerful text editor in existence, bar none. Fallen is not straying you wrong if you're willing to accept the learning curve.
 

Attachments

Vim is the best text editor out there for Linux, i've never really been in need of some shitty heavy IDE to use on Linux. Easy multi-tasking, very easy usage when you start getting used to stuff, etc. yes, it requires some learning but that's not as much learning as you would with some other TE(i.e emacs).

So, after I learned a bit about vim, I found it the most useful Text Editor I've ever used then started digging in.
"Notepad++" - I recently noticed a lot of users over here use it in communication with Linux and windows to edit some useless line in some lua file then reload their server or whatever in putty later on, which is pretty funny.
 
Hmm, I was hoping for something nice; the thread title didn't tell me it was for Linux only.
 
There's a port for windows, tottaly forgot about it, I'll edit the post.

EDIT: Ok done, but careful you might need to change the paths.
 
Last edited:
Scite is faggotry in comparison to Vim, Sublime Text, and ZeroBrane.

For Lua, it pales bad badly compared to ZeroBrane. I mean, fucking look at this. He codes live, from blank editor to a running app on a tablet in 20 minutes.

But this thread is about Vim. Damn it.
Some tips
Tutroial Videos

Scite... Wasn't that just a proof of concept demo for Scintilla? :p
 
Back
Top