[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/fvt/ - Friendly Vim Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 224
Thread images: 23

File: 1462513812315.png (229KB, 1920x1048px) Image search: [Google]
1462513812315.png
229KB, 1920x1048px
Previously >>58685968

>About Vim
Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X.

>Why Vim
Vim is rock stable and is continuously being developed to become even better. Among its features are:
#persistent, multi-level undo tree
#extensive plugin system
#support for hundreds of programming #languages and file formats
#powerful search and replace
#integrates with many tools.

>I want to use Vim but I don't know the keybindings/Nano is easier
#Learning them is easy and you only actually need a select few: navigation, search, b, i, w, :line, v and a few more
#Install Vim and get started with the built in vim tutor: vimtutor - very easy 7 lessons, takes you 30 minutes and you are there.

>I want to use mouse and click
While you can certainly do them in Vim, you will become too lazy to take your hand off the keyboard once you get comfortable with Vim.

>Vim is just a text editor
True, but you can scale Vim to be the IDE you want it to be: C/C++, Java, C#, Python, Haskell, Javascript - anything you like.


Neovim users and potential new users are also welcome.
>>
Who else rocking that vim + tmux combo?
>>
install emacs
>>
>>58704330
elisp is kinda hard
>>
>>58704323
sometimes
always on the server though
>>
>>58703527
>most UNIX systems and with Apple OS X.
OS X is the only Unix around faggot
>>
>>58705030
No hate against macOS (I'm on it right now), but it's definitively not the only UNIX around.
>>
>>58705030
>I'm the most ignorant person on /g/
Gotcha
>>
>>58703527
What's the point? I'll never be able to do anything that requires the power of vim. I might as well stick with nano ;_;
>>
>>58705172

I use the power of vim daily at work. Can't write or edit without it now.

Even on my shit work Windows machines. Someone made a pretty comprehensive emulation of vim for Visual Studio. And I use vim itself as a scratchpad. It's replaced notepad++.

- Macros.
- Registers.
- Magic redo last action key . (dot).
- Movement commands.
- Commands paired with movement commands.
- Linewise operations (cut copy and paste entire lines etc.).

Here's how you swap the order of 2 lines on Windows editors.
Home, Shift+End, Ctrl+X, Down, End, Enter, Ctrl+P
, oh and go clean up the empty line you left.

Here's how you swap the order of 2 lines in vim.
ddp.

Okay, but that was too easy. What about moving the line to line 85?
dd85GP
>>
>>58705795
No, the only thing I ever do is edit config files. I will never utilize vim properly
>>
>>58703527
My .vimrc is good for beginners imo, since it turns basic shit on like syntax highlighting, autoindenting and line numbering. If tabs instead of spaces or 4-character indents are not your thing, then you can change the set shifwidth and set tabstop values (remove the shiftwidth one in you want spaces, increase both to 8 if you want 8-char tab indents).
syntax enable
set shiftwidth=4
set tabstop=4
set number
set smartindent
colorscheme delek
imap jj <Esc>
>>
>>58705886

The power of vim lies in editing. Not writing. It's modal, so if you're always editing existing config files, you stay in normal mode 99% of the time. You're not typing new code, so you don't need to be in insert mode. So then every single key on your keyboard is available for jumping around text and manipulating it.

Say you want to replace the text between a bunch of xml tags with the same thing. Get your cursor on the first character you want to change. Hit ct<, it deletes all the text up to the next < character and puts you in insert mode, then type your replacement text and hit ESC. Scroll down to the next one, cursor to the first char. Then press the period key. It repeats what you just did, deletes up to the next closing tag < char, and types in your replacement text, all in one button press.

There are literally thousands of ways to combine these cut/copy/insert/paste commands, by word, by line, up to whatever arbitrary character you want.

Learning vim is easy. Gives some variety to editing and makes you much faster along the way. You literally lose nothing by learning.
>>
File: 1441141885894.jpg (24KB, 450x450px) Image search: [Google]
1441141885894.jpg
24KB, 450x450px
>>58706023
>colorscheme delek
>imap jj <Esc>

coloscheme darkblue

imap <S-Enter> <Esc>


The patrician choice.
>>
What are the Vim add-ons that make Sublime Text useless? There is one of "those" types in my school and I want to make him cry.
>>
>>58706379
jj is comfier imo, but holy shit does darkblue look good.
>>
What are the cons of using Evil-mode as opposed to straight Vim?
>>
What terminal emulator do you guys use?
>>
File: 2017-01-29 19:10:05.png (46KB, 1918x1062px) Image search: [Google]
2017-01-29 19:10:05.png
46KB, 1918x1062px
>>58707008
I use termite. Previously I had used urxvt but termite does everything that I needed a ton of plugins for in urxvt out of the box. Furthermore many fonts cause problems in urxvt while is is easy to add any font in termite.
>>
>>58707008
in neovim
    function! GetTerm()
999wincmd j
999wincmd l
if &buftype == "terminal"
vs
wincmd l
setlocal wfh
else
botright 20new
999wincmd j
999wincmd l
setlocal wfh
wincmd J
endif
e term://zsh
setlocal nobuflisted
setlocal bufhidden=delete
startinsert
endfunction
nno <leader>sh :call GetTerm()<CR>
>>
>>58707165
I'm using terminator right now. It seems pretty awesome. Before I was using gnome/mate terminal with multiple tabs.
>>
>>58706023
Please leave.
That shiftwidth will fuck up so many people's Makefiles.
>>
>>58706871

2nding this.

I adore vim modal editing and all it's bindings. But the program itself is a clusterfuck. It's so spaghetti there's still not even an agreed upon way to add extensions, and they're limited in scope by shitty vimscript.

I feel like I might want vim inside the emacs environment. But I've not made the plunge yet.
>>
>>58707270
How? It puts actual tabs into the file, which is what make uses, right?
>>
File: scr.png (15KB, 555x315px) Image search: [Google]
scr.png
15KB, 555x315px
>>58706379
>>58706023
elflord is the only viable built-in colour scheme
>>
CRITIQUE MY VIMRC
set backspace=2
syntax on
filetype indent on
set autoindent
set number
colorscheme badwolf
set nobackup
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set clipboard=unnamed
set ruler
>>
Post cool .vimrc shit.

set relativenumber "line numbers relative to the current line
set linebreak "when wrapping, don't break words
autocmd bufwritepost $MYVIMRC source $MYVIMRC "when saving .vimrc, reload it

"mappings

"let OO and oo insert blank lines above and below in normal mode
nnoremap OO O<Esc>k
nnoremap oo o<Esc>k

"auto-add matching brace
inoremap{<CR> {<CR>}<Esc>ko

"F2 for bash in vim
noremap <F2> :tabe bash<CR>:!bash<CR>:bd %<CR>

"Let j and k behave like other editors on wrapped lines
nnoremap j gj
nnoremap k gk

"Leader + w to write as root
nnoremap <leader>W :w !sudo tee > /dev/null %<CR><CR>
>>
>>58707497

I use it for console mode.

gvim the contrast is too high, at least on shitty Windows.
>>
>>58703527
> >Vim is just a text editor
>True, but you can scale Vim to be the IDE you want it to be: C/C++, Java, C#, Python, Haskell, Javascript - anything you like.
Stop this awful "Vim as an IDE" meme.

>>58707583
you're missing a few great settings, like
set nocompatible
set wildmenu
set path+=**
set rnu

>>58707165
this is objectively the best color scheme
>>
>>58705795
G moves you to the end of the file nigger
>>
>>58703527
How do I make the cursor move faster? Total noob, btw.

Feels like when I scrolling down by pressing j in edit mode, it takes to damn long to get to the end of the file.
>>
>>58707165
which color scheme is this
>>
>>58707693
jellybeans
>>
>>58707362
I use Spacemacs which is pretty good at implementing vim, I'm just not sure if I'm missing out on something by using evil-mode instead of plain vim

Emacs is a lovely operating system, and finally putting a decent text editor into it feels great
>>
>>58704355
elisp is leagues ahead of vimlang. I think spacemacs is a good combination of emacs and vim, would highly recommend it, been using it for a while now and I don't miss anything from stock vim.
>>
>>58707615

Re-written from memory so may have mistakes.

" I prefer Enter to insert new lines, and the cursor moves with it.
nnoremap <CR> o<Esc>
nnoremap <S-Enter> O<Esc>

" Shift-enter is kinda convenient to exit insert mode. Not the best though. Need to come up with something better.
imap <S-Enter> <Esc>

" Make leader key the spacebar.
let mapleader = " "

" Space followed by yank/delete/paste to go into the MS Windows clipboard. Also pressing Enter with a visual mode selection to copy it (like how you copy using crappy cmd.exe, it's actually kinda convenient).
nmap <Leader>p "+p
nmap <Leader>P "+P
nmap <Leader>y "+y
nmap <Leader>d "+d
vmap <Leader><CR> "+y

" Paste in insert mode with Control Enter.
nmap <C-Enter> "+p
imap <C-Enter> <C-r>+

" Split a new empty vertical window.
nmap <Leader>v :vnew<CR>
" Bring up vertical file explorer (it's s because I thought it was the classic :Sex command, but that splits it horizontally)
nmap <Leader>s :Vex<CR>
" Open 2 files side by side then hit space d to diff them.
nmap <Leader>d :diffthis<CR><C-w>w:diffthis<CR><C-w>w
" Standard write/quit.
nmap <Leader>w :w<CR>
nmap <Leader>q :q<CR>
nmap <Leader>x :wq<CR>
>>
>>58706379
>>58707497
That's not how you say 'evening'
>>
File: G.png (37KB, 688x502px) Image search: [Google]
G.png
37KB, 688x502px
>>58707640
>G moves you to the end of the file nigger

Well this is a bit embarassing m8.

See also: gg (also in screenshot).
>>
File: 1485669859100.png (139KB, 2184x1344px) Image search: [Google]
1485669859100.png
139KB, 2184x1344px
I have Ubuntu, neovim, and can't get youcompleteme to work -_-
>linux noob
what are common noob mistakes

Is it actually hard to install youcompleteme, or will i be able to do it following the github guide step by step?
>>
>you can scale Vim to be the IDE
Neither VIM nor Emacs are any good as an "IDE"
>>
>>58707961
>what are common noob mistakes
Installing ycm is a pretty big one
>>
>>58707689
1. set mouse=a
2. go to a line by :line_number
3. go to the end of line by $
>>
>>58707961
Not at all. See
https://twinnation.org/articles/How_to_install_YouCompleteMe_for_VIM_using_Pathogen_on_Ubuntu.php
>>
>>58707622
Yeah, I love gruvbox in gVim. When using the plain old linux terminal though (no X) I use elflord.
>>
>>58707914
"moving tabs with a mapping (but you should use buffers)
noremap <leader>gt :+tabm<CR>
noremap <leader>gT :-tabm<CR>

"toggle line wrapping
noremap <leader>w :set wrap!<CR>

"open .vimrc, scroll to the bottom
noremap <leader>v :e $MYVIMRC<CR>G

"toggle spell checking
noremap <leader>s :set spell!<CR>
>>
>>58707689
Either press G to go to bottom
Or press #G to go to line #
Or press #j to go down # lines
Or press C-f to page down
>>
>>58707906
Anything you miss from non-stock vim?

Also I love the fact that I can use C-a instead of ^ or 0, ^ and 0 are super clunky imo
>>
>>58707979
Justify this statement
>>
File: 1483621515451.png (320KB, 1979x1346px) Image search: [Google]
1483621515451.png
320KB, 1979x1346px
Because it hasn't been posted yet
>>
Im already pretty comfy with vim, but can somebody recommend me some nice plugins? I'll be even more amazed, maybe some for haskell?
>>
>>58707008
termite
>>
>>58707640
not when used like this: <n>G,
then it jumps to line <n>
>>
>>58707689
<n>j
go n lines down
(works with all movement commands , like G or w)
>>
>>58707689
Ctrl+D for down and Ctrl+U for up.
>>
>configs
>plugins
>various versions
>default controls
it's so overwhelming
i feel like i can;t get into it
>>
>>58710166
just do the vimtutor, it's easier than you think
>>
>shit plugins for autocompletion and boilerplate
>have to use a key to do autocompletion at all
>shitloads of learning to do what GUI editors can do with a click
I don't see the point of vim, besides to pretend you're clever on /g/
>>
>>58710324
>>shitloads of learning
>>>/kindergarten/
>>
>>58710365
you were taught vim in kindergraten? I'm sorry about your childhood buddy
>>
>>58709568
How about using _? Same as ^, though not the same as 0.
>>
My two cents: if you have the free time to learn Vim from the ground up, the Vim User Manual blows the fuck out of the Vimtutor, IMHO, and is the logical next step if you want to get more comfortable using Vim.

Can be reached with ":help usr_01.txt", which will teach you the other useful things to know about using the guide (like Ctrl+] and Ctrl+o to switch topics). If you didn't already know, you can use ":only" to make a given window the only one, effectively fullscreening it.
>>
>>58705795
After years using Vim I switched to Visual Studio Code.

Sure, you can type faster with Vim, but I like the Typescript integration better, and turns out typing is not my bottleneck when it comes to programming time. It's thinking.
>>
>>58708382
ty anon
>>
>>58707981
alternatives?
>>
Answer me this vim niggers >>58710968
>>
>>58703527
Which font is this?
>>
>>58707689
few options for moving around a file faster

gg or G for top or bottom of the file

{number}{j|k} for going up or down multiple lines at a time

ctrl+f or ctrl+b for going forward or back a screens worth of the file (if youre a tmux user with the default prefix, might wanna swap it to ctrl+a or something if you dont wanna double tap ctrl+b all the time in vim)
>>
>>58703527
>void
>Usage(void)
>{

No.
>>
>>58707961
mucomplete is just as good and it's not as bloated and doesn't require python
>>
>>58711403
Some GNU/Linux distros do indeed ship with vim instead of vi, because almost no one uses the original vi, and vim is mostly compatible with it.
But if you installed an operating system that's closer to UNIX, you will actually get the original vi.
All the BSDs for example and some minimal linux distros don't have vim by default.
>>
>>58703527
>Vim is rock stable
Fuck no it's not. It's really the only serious reason why I keep looking at emacs, too. In the latest version (8.0 or so), there's a bug where in mouse=a mode, using the mouse can randomly do random actions (randomly insert random characters that are not consistent with escape codes, randomly move around the buffer, etc.).
In the previous version (7.3?), if vim was opened for too long, it would start breaking its undo history. This would cause things like failing to remove a line except while undoing the rest of the changes, making a complete mess of the file. It was not possible to undo that by redoing as the extra line would still be present.

Really the only reason why i haven't moved to emacs are the garbage control scheme and the fact its plugins are more buggy than core vim.
>>
>>58707165
urxvt is a huge meme. Any other terminal emulator will do everything you would use hundreds of plugins for in urxvt, out of the box.
>>
>>58706871
Evil-mode is about 10%, if that, of vim's keybinds. For plain editing a single file, it works reasonably well. If you have more than one buffer, not so much. Additionally, it doesn't play well with most other emacs plugins and has ridiculous amounts of bloat precisely to deal with plugins on a case-by-case basis (even that doesn't work all too well).

Personally I find that it's not good enough at all to use, and when I try to use emacs, I just end up using the emacs keybinds rather than evil's.
>>
>>58711403
It's disgusting, but in the end, I care about the software, not its politics.
>>
>>58713760
This.
It can't into true-color, can't into proper font config, there are so many things it can't do despite things like st (which is 1/8 the size) having no problem with.
>>
Can Vim do this?
>>58713176
>>
>>58713797
This is a screenshot of vim in action with random shit in the last column.
>>
>>58713816
So I can install vim and essentially just use it for programming in python? And then I can change parts of the OS to give have messages?

Does it run on any shell?
>>
>>58713912
>give have
I can't type for shit today, sorry.

Give custom*
>>
>>58711422
source code pro
>>
is there any good guide outside of vimtutor that I can download
already can use it basically and did vimtutor but I cant do anything cool
>>
>>58713912
vim is a text editor man, you can program in smoke signals if you want but some tools are better suited than others. So yes, you can program python in vim. That screenshot is some high res desktop with dot files open and directory listings. if we weren't on /g/, i would think it's irony.
>>
>be me
>be using vim for years
>only just found out a week ago that capital D does d$ and capital C does c$
>JUST

All those key presses wasted over the years...
>>
>>58703527
Is O'Reillys Learning the vi and Vim Editors a good reference for learning Vim?
>>
I just want to be able to point and click on a character, and have the cursor move there!
How to do this?
>>
Give me a recommended vimrc list that has nice autoclose, syntax checker etc without the use of clang for C/C++ development.

>>58715999
see >>58710590
>>
>>58716019

That literally defeats the purpose of using an immersive text editor. Efficient editing comes with your hands in one position doing all the magic. You might as well ask for how to plug up an Xbox controller.
>>
>>58716056
I just hate counting lines and doing 5j or something.
>>
>>58716019
echo "set mouse=a" >> ~/.vimrc
>>
>>58716041
Well I can use Vim fine, I just want to know if it is a good reference.

>Give me a recommended vimrc list that has nice autoclose

Check it:
http://dotshare.it/category/vim/rc/
>>
>>58716061
See >>58716070
Want to go to a line?
:<line_number>
>>
Best IDE for Python? Also, how to make Vim an IDE for Python? Is that just a meme from OP?
>>
File: 1457319064876.jpg (57KB, 496x626px) Image search: [Google]
1457319064876.jpg
57KB, 496x626px
>>58716280

>how to make Vim an IDE

you don't
vim is a text editor
>>
>>58703527
Use emacs instead
>>
>>58716061
enable number and relative number
The line you're on has the current line number, every other line number is replaced with the offset amount.

4
3
2
1
184 <CURSOR HERE>
1
2
3
>>
>>58716280
http://www.vim-bootstrap.com/
>>
File: 1479090105382.jpg (24KB, 599x338px) Image search: [Google]
1479090105382.jpg
24KB, 599x338px
>>58716476
>What Is Vim?

Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.

Vim is often called a "programmer's editor," and so useful for programming that many consider it an entire IDE. It's not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.

Despite what the above comic suggests, Vim can be configured to work in a very simple (Notepad-like) way, called evim or Easy Vim.

>What Vim Is Not?

Vim isn't an editor designed to hold its users' hands. It is a tool, the use of which must be learned.

Vim isn't a word processor. Although it can display text with various forms of highlighting and formatting, it isn't there to provide WYSIWYG editing of typeset documents. (It is great for editing TeX, though.)

>Source
http://www.vim.org/about.php

OP here I want NO further comments regarding this
>>
>>58716597
>530 line file for 2 langauges
>loads of remapping
>28 plugins
absolute shit.

>>58716619
OP here stop trying to pretend to be me
>>
>>58716765
Take your butthurt somewhere else, this is a friendly thread.
>>
File: 1459972703405.jpg (96KB, 1280x720px) Image search: [Google]
1459972703405.jpg
96KB, 1280x720px
>>58716619

>I want to disfigure this beautiful woman called vim by forcing her to chug plugins and remaps

>>>/emacs/
>>
File: whores_lauging.jpg (377KB, 1735x1227px) Image search: [Google]
whores_lauging.jpg
377KB, 1735x1227px
>>58703527
>This code style {
>/*****/
>}
>>
File: 1472681830671.png (77KB, 497x1093px) Image search: [Google]
1472681830671.png
77KB, 497x1093px
>>58717001
>>
File: 1456968609427.png (38KB, 1920x1080px) Image search: [Google]
1456968609427.png
38KB, 1920x1080px
now what
>>
>>58717266
exit, and start vim like this:
vim filename

also try vimtutor
>>
File: 1463010671345.png (42KB, 1920x1080px) Image search: [Google]
1463010671345.png
42KB, 1920x1080px
>>58717266

my .vimrc rn
>>
>>58717266
Start programming
>>
>>58703527
What're some must have python plugins? no autocompleting ones though
>>
>>58717619
Python is just text you should not need any. Configure your syntax checker properly and you are good to go
>>
>>58715924
Holy fuck why didn't I get that earlier

This is like learning about capital A all over again
>>
>>58717619
This >>58717640
Configure a command to execute the current script/highlighted text and you have all you need.
>>
>>58717640
Because of the whitespace meme, you absolutely need some alignment guide as well as some autoindent on newlines.
>>
Which of these do you use for code completion?
http://vimawesome.com/?q=cat%3Acompletion

youcompleteme is too heavy for my toaster
>>
I use a different one per language. For C++, I use the clang one. For python, I use python-mode (though I'd love to find an alternative, because it's slow as fuck on a good machine because >python)
>>
>>58719133
Get mucomplete with omnisharp database
>>
>>58719372
>omnisharp
omnicompletion*
>>
what does nocompatible do?
>>
>>58704323
always since I use st so tmux provides history and tabs
>>58704330
tried and would rather write my own than use it... elisp is a mess
>>58705030
guess that means OpenBSD, FreeBSD, and NetBSD are too since OSX is almost the same if you take away the GUI
>>58707981
What should I us then? It works without any issues so I don't see what's wrong with it and if it's "turning vim into an IDE" say hello to all the Haskell plugins
>>58719440
give up being 1 to 1 compatible to vi
>>
>>58719570
>give up being 1 to 1 compatible to vi
what is the benefit of that?

I enabled it and nothing seems different
>>
>>58719587
:help nocompatible
>>
>>58719440
Makes vim non-shit.
>>
I've been using vim for the past year and a half, and I don't know much about the cool command it can offer. I use dd and yy, and some other, but what are some really usefull command that i should know ?
Also, what kind of vimrc mods should I do ? I got syntax highlighting and a autocomplete plugin among some others.
I code in C and Python mainly.
>>
>>
File: vim-docbrowse.webm (1MB, 1366x768px) Image search: [Google]
vim-docbrowse.webm
1MB, 1366x768px
>>
File: vim-ssh.webm (876KB, 1366x768px) Image search: [Google]
vim-ssh.webm
876KB, 1366x768px
>>58719816
>>
File: vim-mouse.webm (787KB, 1366x768px) Image search: [Google]
vim-mouse.webm
787KB, 1366x768px
let the hate flow through you
>>
>>58719783
>>58719816
>>58719826
>>58719838
vimrc pls
>>
>>58719838
Delete this
>>
>>58719816
>>58719826
>>58719838
sexy
it actually convinces me to finally try vim, it looks so convenient
>>
>>58719869
this is my latest (uses vim-plug for plugins, install that first then run :PlugInstall)

It's really only set up for Go and some minimal web dev

http://pastebin.com/raw/CTpxs2vq
>>
>>58719945
Also it's not commented well, but you should read the few comments that are there. Might be of interest.
>>
I currently use vscode for work since it has a nice built in debugging frontend.

There are a couple commands I really like in vscode but aren't available in vim as far as I can tell.

Search Current Directory Ctrl+P
Find next instance and highlight Ctrl+D

When I tried to do a search an replace in vim I need to write something like /%s/foo/bar or whatever which is pretty cumbersome, plus not sure how you work with file directories in vim or do a search.

Any pointers?
>>
>>58719945
>>58719963
and also I'm using tmux in those screen shots.
>>
>>58717133

GNU is most readable. Allman is fine too.
>>
Vim defaults tabline is shit, so I shit'd it a bit.
set tabline=%!MyTabLine() " sets up tabline

function MyTabLine()
let s = ''
for i in range(tabpagenr('$'))
let active = 0
" select the highlighting
if i + 1 == tabpagenr()
let active = 1
let s .= '%#TabLineSel#'
else
let s .= '%#TabLine#'
endif

" set the tab page number (for mouse clicks)
let s .= '%' . (i + 1) . 'T'

" the label is made by MyTabLabel()
let s .= ' %{MyTabLabel(' . (i + 1) . ')} '

" append some flags, e.g. [+], [-], [RO]
if active
let s .= '%m'
let s .= '%r'
let s .= '%h'
let s .= '%w'
endif
endfor

" after the last tab fill with TabLineFill and reset tab page nr
let s .= '%#TabLineFill#%T'

" right-align the label to close the current tab page
if tabpagenr('$') > 1
let s .= '%=%#TabLine#%999XX'
endif

return s
endfunction

function MyTabLabel(n)
let buflist = tabpagebuflist(a:n)
let winnr = tabpagewinnr(a:n)
let bufname = bufname(buflist[winnr - 1])

" default name for empty buffer
if bufname == ''
let bufname = '[No Name]'
endif

" strip path
let bufname = fnamemodify(bufname, ':t')

return bufname
endfunction
>>
>>58719980
>Search Current Directory Ctrl+P
install CtrlP
>>
>>58719980
>Find next instance and highlight Ctrl+D
On any text, press *
n for next
N for previous
>>
>>58710539
About the same as ^ though, not really very convenient
>>
>>58717619
so wait is vim literally just a text editor that you can rice? is that why /g/ uses it?
>>
>>58720478
It can serve as an IDE which is what quite a few here do. It also has the ability to be kept in a tmux session which means you can easily work on your code from a remote location over ssh.

You can "rice" it but most plugins are for functionality such as slime, rainbow parenthesis (mostly for lisp), vim-easytags, ect...
Think of it as a productive lazy programmer tool who would rather write programs to handle problems/checks than jumping ship or dealing with it.
>>
>>58720535
is it worth learning if I already use sublime on a daily basis? what are the key differences between vim and emacs (if this question is stupid sorry I'm interested in learning about them, but I know people compare the two heavily)?

The tmux session sounds super useful desu
>>
Newbie here.

Can someone explain the whole buffers/splits/tabs thing?
Like what are the usual/best practices and vimrc stuff that people use?
>>
>>58719838
did someone made this work on windows 10 ?
the mouse was working fine on my win7 last summer but now its not. It was very handy to resize everything by draggin', now i just have multiple tabs because it's faster D:
the :set mouse=a does nothing on the cmd.exe and powershell
>>
>>58720631
Buffers can be thought of as a file object
Splits are a way of showing more than one buffer at a time on the same screen
Tabs are a way to allow multiple split layouts
>>
>>58713776
Could you be specific? Using spacemacs, I have had no issues with it, and even without it, I find that using Emacs keybindings for most things is just fine, with evil being used for editing the current buffer
>>
what do you fags use plugins/customizations for? I use the defaults and vim seems great, recently switched to nvim and haven't seen much of a difference.
>>
>>58710166
>configs
Just start with the basic ones you deem absolutely necessary for a text editor, like syntax highlighting, line numbering, etc (these are just common examples, not things everyone finds necessary)
>plugins
Just ignore them for now, vim is perfectly fine without plugins.
>various versions
The best version is probably the latest, which is the most likely to be in the repos, but even if it's a couple versions older, you can start worrying about it once you became proficient at using vim.
>default controls
vimtutor
>>
>>58720668

But if I could have just one buffer or file per tab, why use splits at all? Is it faster to move through them?
>>
>>58720992
I'll put the autistic (and effectively canonical answer) first: if you use tabs like that in vim, you're doing it wrong.

In all honesty, I like using splits, if you have a large enough monitor, they're actually a more effective solution than tabs. Once you start combining them with tmux then they become super powerful.

Tabs certainly have their uses, and at the end of the day if you want to use them like notepad++ tabs you can, but you'll be missing out if you do
>>
>>58704323
No, i3 is just graphical tmux
sort of
>>
>>58720619
I would say it depends on how you plan to work (should really say yes) and I'll list a few things you might find interesting.

If you plan to work away from your main like I do then vim is better since you can access it over ssh with tmux.
If you want the cua mode sublime uses you can with a plugin if you don't want the vim controls.
If you like to be comfortable when working on servers which only have vi installed or ed... the standard editor.
If you like having the editor working your way instead of working around it. I have mine like an IDE for both C and Haskell while working well with scheme lisp by a port of the slime plugin for emacs (uses tmux).

Emacs is the other editor in the "editor war" as it is capable of doing what vim does and more... but it's huge, bordering an IDE in most cases and forces you to learn elisp if you ever hope to get plugins open requiring a change in the configuration file.

To make things easier I suggest to install Vundle if you plan to run plugins as it will fetch them for you and is the easiest to work with imo.

Also sorry for taking such a long time to respond (cleaning the flat).
>>
>>58705795
If you want to move line 10 to line 85:
:10move85, or :10m85
To move the current line:
:.m85
To move 10 lines down:
:.m+10
To move the line 10 lines up to the cursor:
:-10m.

You get the idea. Vim's great.
>>
>>58707689
All of these answers are wrong and you idiots should be ashamed. The correct answer is that Ctrl-E scrolls down without moving the cursor, and Ctrl-Y scrolls up. Ctrl-D and Ctrl-U scroll down and up half a page. After scrolling you could use L to move the cursor to the bottom of the screen, M to move it to the middle, or H to move it to the top. This is the Correct Vim Way.
>>
>>58710166
Google for a cheat sheet and stick it up behind your monitor. Because I did that, I know every single-letter keybind, and use almost all of them regularly.
>>
>>58710166
See
>>58709645
>>
>>58710166
use Vundle to install plugins and install cua mode if you don't want vim keybinds
>>
>>58720631
http://vimcasts.org/episodes/working-with-buffers/
>>
What's the deal with power line? Any other plugins I should get? I'm pretty comfy using default VIM.
>>
>>58706023
>>58706379
Why not use caps lock as esc?
>>
>>58721741
custom line > tiny-line > air-line > powerline
>>
>>58721741
power/airline is just bloat
just get syntax if it's missing and use vim's autocomplete unless you need something more advanced
>>
>>58703527
Evil mod exist
>>
>>58722111
evil is a pain to setup and buggy as hell
>>
>>58720667
halp ! no one is on windows 10 here ? D:
>>
ci( or cib
ci{ or ciB
ctrl+a and ctrl+x with the cursor on top of a number

thank me later
>>
>>58703527
I tend to use kate with the konsole plug-in.

Sell me this text editor, /g/.
>>
>>58722763
Anything kate can do, Vim can do. Better. With more plugins.
>>
>>58713912
>this is the state of /g/ in `[current year]`
>>
How can one get something like
----->

instead of
>-----

with analogue to
set listchars=tab:>-

??
>>
>>58723544
I'm going to need specific examples. My developing time is bottle necked by my skill rather than the editor.
>>
>>58723925
Better plugins for auto completion and error checking.
>>
>>58723954
More and more detail, if you will. vimpill the shit out of me.
>>
>>58724004
You ought to try it yourself.
It's a really matured editor, there's plug-ins for everything.
>>
>>58721821
1) This is just my personal preference, but pressing jj is more comfortable than pressing caps lock
2) jj can be set in the .vimrc, while you have to remap caps lock in the xorg settings. This is bad because I often use vim on a headless server, and because this means I can't use caps lock in any program, not just in vim.
3) Caps lock is sometimes useful, some programming languages have syntax that requires uppercase letters (like SQL), and sometimes it's just standard practice to give an something an uppercase name (like #define-d constants in C), and I really hate typing whole words out while alternating between the two shift keys.
>>
>>58706414
Vim can be impressive on its own when you get the hang of it I'd say, but a plug in that could make Vim quickly look impressive is YouCompleteMe. Probably.
>>
>>58721589
no problem anon thanks for the advice! I'll check out vim then since I work on my desktop and laptop often and switch between the two due to school.
>>
teach me how to buffers
>>
>>58724872
I'd say that a keystroke instead of two is pretty big deal since esc is one of the most pressed keys.
Moreover it's not like caps lock goes away, the keys are swapped, and you use esc way more than you use caps lock .
>>
>>58725526
I should have elaborated on that, I find it comfortable, since I prefer pressing a key with my index finger twice over pressing a key with my pinky once. Also my keyboard has a really awkward caps lock key and a really small Esc key.
>>
>>58726056
I can see that
>>
https://ptpb.pw/cH5D

Critique my vimrc please.
>>
File: i-hate-my-computer-14456531.jpg (86KB, 1300x955px) Image search: [Google]
i-hate-my-computer-14456531.jpg
86KB, 1300x955px
>>58719838
>thirteen hundred six and sixty by seven hundred eight and sixty
>>
>>58720674
No *panes, no tabs, basically no buffer ops, bad/no op-pending mode, and just google evil-mode <plugin> to see the ridiculous amount of adaptation packages it has. Additionally, no good minibuf/temporary buffer support (though popwin helps here, it also needs many adaptation packages to deal with different plugins, because just like evil, it's a hell of a hack).
>>
>>58719838
How do you make the mouse work on the right pane? No version of vim has ever worked for me when clicking past the ~120-130th character (it seems to warp around to the beginning and start counting from there).

That said, this webm shows exactly how a mouse should be used. Keybinds are extremely inefficient for these operations.
>>
>>58723744
Bumping for this, also interested.

Or perhaps if anyone has a suggestion as far as what they use to visually represent tab chars
>>
>>58726492
could this be part of the issue:

https://stackoverflow.com/questions/7000960/in-vim-why-doesnt-my-mouse-work-past-the-220th-column#19253251

Sometimes this can also be cause by your terminal emulator, shell, or terminal multiplexer (eg tmux).

My mouse settings:

"enable mouse
if has("mouse_sgr")
set ttymouse=sgr
set mouse=a
else
set ttymouse=xterm2
set mouse=a
end

>>
File: voom_anim.gif (102KB, 532x561px) Image search: [Google]
voom_anim.gif
102KB, 532x561px
>>58703527
Anyone tried VOoM? Link https://vim-voom.github.io/

I need an outliner, but more than that, I need to replace Gjots2. Gjots2 is awesome thanks to the tree view of contents and the operations. I believe VOoM can do all that (pic related).

Please, I need to organize my thinks. Help!
>>
>>58703527
What a shitty unreadable mess.
>>
>>58726438
Spotted a nazi
>>
who /neovim/ here?
>>
File: Roguelike players.png (391KB, 800x570px) Image search: [Google]
Roguelike players.png
391KB, 800x570px
>>58703527
Hey OP, may sound strange but can you put a link to the roguelike general?

You know, is very easy to pick up vim after you play dungeon crawl after a while. Think about it, here is the link >>>/vg/rlg
>>
>>58727237
I've tried on tons of setups, from konsole, mate-terminal and gnome-terminal to xterm, tmux and screen, and never got it to work (works significantly worse on tmux/screen of course, for example the alignment is wrong for dragging borders, if that's even allowed).
I'll try sgr for sure, didn't know that was a thing.
>>
>>58707615
why line break. why is this the default. why line break on words.
are you reading books in vim?
>>
>>58731132
what if you for example edit latex in vim?
>>
>>58719838
> This is litteraly my setup.vim
>>
>>58729145
Is launchpad dead?
I can't install a thing! Including neovim
>>
>use vim because muh lightw8
>install a billion fucking plugins
you fags are ridiculous

>>58729145
>feature list: eh.... we put neo in front
>>
>>58733279
>because muh lightw8
As a text editor, it is lighweight enough
As an IDE you need plugins, but it is still more lightweight than many IDEs
>>
>>58717619
I use neomake for async syntax checking/linting (you can choose pyflakes/flake8/pylint/... or configure your own linter).
Jedi-vim is nice for the argument hinting e.g. if you enter print( it will show the argument names of print. It also does context aware variable renaming and go to definition.
You can use tagbar if you have trouble navigating your functions but [[ is usually fine in python
>>
Anyone else have syntastic?

I want to add a custom include folder for c
let g:syntastic_cpp_include_dirs=['/usr/include', '/usr/include/json-c']

But it does not seem to work
>>
What are some must have plugins?
>>
>>58734103
Nevermind

let g:syntastic_c_include_dirs=['/usr/include', '/usr/include/json-c']
>>
I keep pressing Esc after typing, thanks Vim
>>
>>58707906
>elisp is leagues ahead of vimlang
lisp based languages are leagues ahead of all other languages fampai
>>
File: .png (70KB, 1394x914px) Image search: [Google]
.png
70KB, 1394x914px
who here /ascended/
>>
>>58734361
Sometimes I want to move around with hjkl when I type a 4chin post.
>>
>>58734881
>what is vimperator
>>
>>58709645
I thought * was the system register.

like "*y and "*p
>>
>>58734982
It is, and so is +. What of it?
>>
>>58734982
I never understood the difference between the * and + registers, both seem to work the same. I use + tho. (remapped <Leader>y/p/d to "+y/p/d to make my life easier, with leader being space)
>>
>>58719570
>tried and would rather write my own than use it... elisp is a mess
>elisp is a mess
Confirmed for too much of a brainlet to do functional programming :^)
>>
>>58721633
>C- keybinds
What is this, fucking Emacs?

Although I guess it's better than C-u # C-n or C-p
>>
>>58726450
So, most of the issues stem from not being willing to use Emacs' way of doing things?
Glad to see that using evil-mode is definitely the right choice for me, and now I understand why it's not the best choice for everyone. It's definitely got its pros/cons, then, but I don't see any of its cons as meaningful at all as long as one is willing to use the Emacs way for everything that isn't pure text editing (which isn't exactly something one SHOULD be willing to do, since it's quite a change in method)
>>
>>58729923
Seconding
>>
>>58734955
Dead after Firefox 57 :^)

>>58734881
>What is VimFx
>>
>>58736614
>>58734955
I wouldn't know, since I use botnet chrome.
>>
>>58736679
>voluntarily subjecting yourself to the normie browser
>>
>>58736614
Yeah what's the deal with the Firefox nuking they are driving towards? Seems like a major fucking destruction for literally nothing. I don't get it.
>>
>>58736714
They want the normie audience because they're fucking retards who don't truly embrace the principles of freedomâ„¢ that are the underlying driving force of good software

They're "open source" cucks and thus they desire nothing but a larger market, because they've bought into the idea that even libre software is, in the end, a business

That's just how the cookie crumbles with big projects. They become business projects, and are subsumed by the retards who do business

It'll allow for intercompatibility with Chrome's suite of extensions, and the retards at Mozilla think that people use Chrome because of some fucking actual merit of the browser itself, rather than its marketing, word of mouth from normies and its very well-made interaction with the Googlesphere

Mozilla, for some fucking reason, thinks Firefox will become more popular by gutting the only reason people use it over Chrome (other than freedom, which Chromium has, and no one really cares about the lack of auditing that much). And so, because Mozilla has become business, it thinks that aping the most popular kid in the room will make it as popular as he is.

It's fucking mind-boggling, is what it is.

There are some genuine benefits too, with regards to security for the mouthbreathers who install anything they see, but those people just shouldn't be allowed to install extensions at all. Make XUL limited to people who know how to enter the config, that'd remove 90% of the people who suffer from the lack of security with the system, but no, Mozilla will just toss out the baby with the bathwater on this one

I will miss Vimperator dearly, but not as much as I'll miss using the internet at all. I can't use the internet without Tab Trees now, it's just too disgustingly awful
>>
>>58705030
>OS X the only UNIX* around
Yeah except for BSD clones, MINIX, and Linux...?
>>
>>58736776
I get that vibe too.

What chances to we have of properly forking the not-shit version of Firecunt and moving on from there without suffocating in our own feces?
>>
>>58736783
>Linux, a kernel that has nothing to do with UNIX besides being made in an era where UNIX philosophy was predominant
>MINIX, a fucking microkernel that intentionally has nothing to do with UNIX
>UNIX systems
*BSD-clones are UNIX systems though
>>
inoremap <Super_R> <Esc>


faggots BTFO

>muh avoid words with jj

>It's a calle captcha episode
>>
Literally the only reason Linux isn't certified UNIX is because you have to pay to get certified.

Being "certified UNIX" is literally meaningless.
>>
>>58719838
vimrc pls
Thread posts: 224
Thread images: 23


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.