ITT:
Vim tips and tricks
ITT:
Install gentoo
Install Emacs
sudo apt-get install nano
Install undotree + configure persistent history. It's like a mini VCS within your editor.
:qa!
Install emacs
Uhh lets see, a tip? Don't try turning your text editor into some faux-IDE. Add whatever plugins but don't try going into vim or emacs and try turning it into an IDE. I've seen some cool C or Python setups though. No Java though, I don't expect anything Java to be done in a text editor unless it's some shitty beginner Hello World file.
map ; to :
:wq!
rm *
:! sudo rm -rf --no-preserve-root /
>configure persistent history
more info on this pls
:h persistent-undo
:map!
:nmap
Map Ctrl + [ as ESC so you can exit insert/visual/command mode without the need to move your hand to far from the center of keyboard.
How do I make a plugin start when I start vim? plugin in question is Undotree, using pathogen
:imap jj
Install sublime text 3
...
pleb
neet
protip: get the vim plugin for your favorite ide and use that instead
I map jk to ESC, it's not like I ever type jk
how do I do it?
>undotree
installed it, read the github, read the :help still don't know how to put myself in that window or control it
What plugins are you using?
>favorite
>ide
Vim tips and tricks.
First tip: don't use it.
Install neovim.
Tip: only use vim if you're sshing. Otherwise, don't waste your time.
What's with all the reddittors hating on Vim?
>if you don't like something I like, you're automatically a redditor
Nice hateful-labeling technique, you sophist.
Now try rebuking the arguments against that shit editor instead of ad-homining.
>t. sublime text user
>doubles down on ad-homining
Nice one, but I wrote my own programmers' text editor on Lazarus using SynEdit.
No, I'm not sharing it with you.
Vim is better than your editor
I've been using Epsilon for almost 30 years. None of your newfag shit is better than it. Stay rectally shattered.
> checkout neovim
> The current stable version is 0.1.7
No thanks.
my editor was developed by a larger team than yours. (I didn't have to write it myself)
Good argument, angry manlet.
I didn't write my editor myself and my editor probably is more stable and mature than yours.
>I can't afford Epsilon, so I'll just call him a manlet
First, lol poorfag.
Second,
>him
I called you a manlet because you posted like an angry manlet (which you are)
Is there any clean, easy to use solution for ctags-like behaviour? I just want to define a regex or syntax element or whatever and get a loclist for them so that I can navigate large text files easily, in any language. Preferably with a tree or something.
E.g.: in latex I want a list of \sections with \subsections that takes me to the line where they are defined, in markdown all # and ## and in python class and def
I've been using my editor for the past 97 years. Your newfag shit is garbage. Stay ass flustered.
Your desperate damage-controlling makes you sound frustrated, son.
Why do manlets like you get angry so easily?
>he doesn't run nano inside vim
>97 years
LMAO! I've been editing text the same way for the past 8 millennia. Remain colonically overwrought.
in command mode:
ctrl+a will go to the next number and increase it by one
ctrl+x will go to the next number and decrease it by one.
ctrl+open bracket will exit insert mode like escape does.
It's :UndotreeToggle, or one of the related commands. You can map it to whatever you want, of course.
Besides that, it is just arrow keys and enter to navigate the version history (which is presented as a chronologically sorted directed acyclic graph)
I can make it open with F5 but I can't make it focus on the window so when I use arrow keys it just moves around the text file I'm editing
Legit question: Is neovim worth it?
:UndotreeFocus will focus it, but you can also navigate it like any normal split in Vim.
Good sir, would you mind sharing how you've done this?
ok thanks, one last thing (new to vim) how do I change back to my text file?
ok so ctrl+shift+l moves me right in terms of focused window, how do I move left?
ctrl shift h, found it
set mouse=a
Install Atom.
inoremap jk
nnoremap ; :
these two lines alone can increase your productivity
UndotreeToggle again, or :q on the undotree pane.
It sounds like you aren't very familiar with vim. I highly recommend avoiding "cargo cult" vim configuration (ie, using configs you don't totally understand). I used to do that, using some big plugin + configuration packages, and it was terrible. I got into weird states all the time and couldn't fix anything.
Instead, build up your Vim config from scratch, making sure you understand everything you add.
If you don't like the default keybindings (which are frequently terrible and unintuitive), remap them.
I use ctrl-arrow keys to navigate splits, ctrl-shift-arrow keys to resize them, alt arrow keys to create a split in a given direction, and Ctrl page up page down to switch buffers within a split.
Was meant for
How the fuck do I get 256 colors in vim on gnome-terminal
REEEEEEEEEEEEE
use neovim
set your default terminal in .bashrc and your tmux-config to support 256. tmux likes screen-256 so you have to use that one.
neovim is vim you cunt
my leader is ,
Therefore, I posted a vim tip, just like the thread suggested.
Learn to compile your own Vim and enable the flags you need.
: kinda makes sense for a leader because : is command
I thought that people were using vim because it was working on terminal without guis and over ssh and basic vim + configuring all on your own was main advantage for them
just switch your caps lock key and esc key it's god tier
autocmd * in your rc look it up
check out tagbar on vim awesome, might be what you're looking for
ctrl-w followed by an arrow key as a direction navigates splits as well
nnoremap j :m .+1==
nnoremap k :m .-2==
vnoremap j :m '>+1gv=gv
vnoremap k :m '
vnoremap h gv
I'm using this to move whole text selections up/down/left/right. Couldn't figure out the correct keycodes so I use escapes sequences.
:wq foo
lpr foo
Sublime is good, and more suited to web development.
If Sublime is powerful, VIM is godlike.
sublime is proprietary
any sane person who knows anything about programming understand why it's stupid to use a proprietary editor
In terms of functionality, no they're practically the same. Neovim comes with a terminal built in but most people use vim with tmux/screen.
Ricers prefer neovim though for truecolor support.
ctrl +o in insert mode allows you to make one normal mode command, then returns you to insert.
Just use :x instead of :wq
>Linux trying to be windows
go ask on reddit /r/vim and people will tell you the basics.
The problem with Vim for me is that its so easy to open a file with Atom on a command line. All you have to do is type "atom {file | folder}". its so easy
or
Shift+ZZ
to save and quit
Good point
kys
Literally the most used vim trick on Sup Forums.
:q!
best autocomplete these days?
giving vim another try
Thanks :O
the builtin autocomplete works well.
other than that there's neocomplete.
if you want some ide-like intellisense completetion, get a different editor.
Hows necomplete vs YCM?
And I dont need anything fancy, just something to ease the verbosity of Vulkan
don't use youcompleteme. it requires quite a bit of setup to make it work, your startup time with ycm will be as bad as emacs, and it's really slow when using it too. there's a noticeable delay on slower machines.
neocomplete doesn't have any performance issues, but it also has fewer features. It "only" has keyword completion, meaning you won't get any smart completion suggestions that you could get with ycm, neocomplete only completes the words that you have typed in the buffer before.
>meaning you won't get any smart completion
well that sucks, i mean i can still use neo, but i guess ill look elsewhere for a solution, thanks
>neocomplete only completes the words that you have typed in the buffer before
not really
this desu senpai
>Mouse in Vim
I really hope you're the last of your species.
something super lightweight though not true auto complete could be supertab
Well you typed it there twice. Also, what if you write some code and then want to express quickly in a comment that you were only joking?
>t. redditor