[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]

/cvg/- Comfy Vim General

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: 72
Thread images: 7

File: 1494098438427-g.png (36KB, 690x335px) Image search: [Google]
1494098438427-g.png
36KB, 690x335px
Previous thread: >>60248333

General Vim discussion can go here, but the main focus is on how to achieve maximum vim comfiness.
>>
File: 1458689709567.png (13KB, 650x650px) Image search: [Google]
1458689709567.png
13KB, 650x650px
>>60297909
I use atom
>>
>>60297909
The best way to achieve a comfy vim setup is to use as little plugins as possible.
>>60298084
>being gay
wew
>>
i don't know how to jump to the start or end of a document so i use the directional keys to scroll all the way through AMA
>>
>>60298166
Would you like to know how to do that?
>>
Spasemacs
>>
>>60297909
> thinking in vi
http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118
> Comfy plugins:
> Manager: Vundle
> molokai
> nerdtree
> indentpython
> vim-surround
> align
> syntastic
> vim-mucomplete
> c-support
> slimv
> airline
> rainbow_parentheses
> Tagbar
>>
there are too many generals on this fucking board

what's there to discuss about vim besides "it's objectively the best editor"??

if you want to know how to do stuff :help or fucking google it
>>
>>60298166
gg -> go to top
G -> go to bottm
>>
>>60297909
i use default vim, lulz
>>
>>60298268
Go complain about the actually cancerous generals that don't belong here, or the 700 billion AYYMD vs JEWTEL threads.
>>
who else defeating the point of having 60000000 keyboard shortcuts by tapping j and k all the time (sometimes in insert mode)
>>
Can someone pls help me to make a simple search & replace function, so far

" Search and replace
vimgrep pattern **/*
cfdo %s/pattern/replaced_pattern/gc

I have no idea what to do anymore
>>
>>60298958
I mean, "recursively" search and replace in a directory
>>
>2017
>still programming in a terminal based text editor
retard, get an IDE with decent UI like Atom or IntelliJ and save yourself 10 years of studying something you don't need. Those two are not bloaty either. Fucking autists still using Emacs and vim, blows my mind.
>>
>>60298287
specially since eclipse and intellij have vim plugins
>>
>>60299020
I use GVim on Windows for my RegEx needs. Come at me.
>>
>>60299020
>atom
>not bloat
You aren't even trying.
>>
>>60299451
bloat on your 1990 pc running gentoo and i3, not on a relatively modern one.
>>
>atom
>not bloat
madness
>>
>>60297909
Any cool key combinations? I read about the most popular ones but I know there is lot more to discover.
>>
File: vim-docbrowse.webm (1MB, 1366x768px) Image search: [Google]
vim-docbrowse.webm
1MB, 1366x768px
obligatory
>>
>>60300169
I like your functionality but how do you not gouge your eyes out using that colorscheme?
>>
File: vim.png (322KB, 1448x982px) Image search: [Google]
vim.png
322KB, 1448x982px
Rate my plugins /g/

I once went all vi-improved using only VCM, netrw, !make and MRU but I think this is less hassle and more comfy imo
>>
Why is neovim so shit?
>>
>>60300363
I work in a well lit room.
>>
>>60300565
What's wrong with it? I haven't used it, so i wouldn't know.
>>
Reposting a .vimrc without plugins (except for netrw, but that is native)

" BASIC SETUP:
" enter the new millenium
set nocompatible
" enable plugins
filetype plugin on


" PERSONAL MAPPINGS:
" save file
nnoremap <F2> :w<CR>
inoremap <F2> <ESC>:w<CR>i
" exit
nnoremap <F3> :q<CR>
inoremap <F3> <ESC>:q<CR>
" leader
let mapleader = "¿"
" localleader
let maplocalleader = "\\"
" edit vimrc file
nnoremap <leader>ev :vsplit $MYVIMRC<CR>
" source vimrc file
nnoremap <leader>sv :source $MYVIMRC<CR>


" TEXT AUTOCORRECTION AND EXPANSIONS:
iabbrev teh the
iabbrev waht what
iabbrev aslo also
iabbrev @@ --<CR>[email protected]<CR>--


" TEXT SNIPPETS:
" Read an HTML template and move cursor to title
nnoremap <leader>html :-1read $HOME/.vim/snippets/skeleton.html<CR>3jwf>a
" NOW WE CAN:
" - <leader>html for HTML snippet
" - can be used to create more snippets


" COSMETIC CHANGES:
" enable syntax highlightening
syntax enable
" colorscheme
colorscheme basal
" background color
"set background=dark
" toolbar
set ruler
" line wrap
set wrap
" when wrapping, don't break words
set linebreak
" indent using previously indented line as example
set autoindent
" indent C-like syntax
set smartindent
" set line number for current line and relative number to the rest
"set number relativenumber


" TAB COMPLETION:
" enable spellchecking
"set spell
" match dictionary words for completion
set complete+=kspell


" FINDING FILES:
" Search down into subfolders
" Provides tab-completion for all file-related tasks
set path+=**
" Display all matching files when we tab complete
set wildmenu
" NOW WE CAN:
" - Hit tab to :find by partial match
" - use * to make it fuzzy
" - :b lets you autocomplete any buffer


" TAG JUMPING:
" - This doesn't help if you want a visual list of tags
" Create the 'tags' file (may need to install ctags first)
command! MakeTags !ctags -R .
" NOW WE CAN:
" - Use ^] to jump to tag under cursor
" - Use g^] for ambiguous tags
" - Use ^t to jump back up the tag stack
>>
>>60301315
cont.
" AUTOCOMPLETE:
" Already set with the tags file
" The good stuff is documented in |ins-completion|

" HIGHLIGHTS:
" - ^x^n for JUST this file
" - ^x^f for filenames (woks with our path trick!)
" - ^x^] for tags only
" - ^n for anything specified by the 'complete' option
" - Use ^n and ^p to go back and forth in the suggestion list


" ELEMENT INSPECTOR:
" Show syntax highlighting groups for word under cursor
" Use ctrl-shift-p to reveal the syntax groups to which the element belongs
nmap <C-S-P> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc


" FILE BROWSING:
" Tweaks for browsing
let g:netrw_banner=0 " disable annoying banner
let g:netrw_browse_split=4 " open in prior window
let g:netrw_altv=1 " open splits to the right
let g:netrw_liststyle=3 " tree view
let g:netrw_list_hide=netrw_gitignore#Hide()
let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+'
" NOW WE CAN:
" - :edit a folder to open a file browser
" - <CR>/c/t to open in an h-split/v-split/tab
" - check |netrw-browse-maps| for more mappings
>>
>>60299020
I've only been using vim for 2 years, and I bet I can edit stuff 10x faster and more comfortably than you can do with any IDE.

I've also modified vim to the point where it is basically an IDE. I have a command that compiles my code and moves the cursor to any errors that have been found. I pretty much never need to move my hand from the home-row, and the result is that I can work extremely quickly.

I'm also using a plugin that flawlessly integrates git into vim.

I've used IDEs before. My experience is they add overhead and I work slower overall.
>>
Reposting intro to vim
# Vim Grammar

**Modal nature** - Insert mode is not the default mode


* Verbs - Operations you can run on the text
* Nouns - Text objects that you can target
* Modifiers - Specify how far the change should go
* Adverbs - Repeat actions with counts and selection
* Macros - Recordable and modifiable sequences of actions
* Commands - Including whole scripting language inside vim

# Verbs

* `i/I` - Insert here / Insert at the beginning of line
* `o/O` - Open after / Open line before
* `d/D` - Delete / Delete till the end of line
* `y/Y` - Yank(copy) / Yank till the end of line
* `c/C` - Change / Change till the end of line
* `s/S` - Substitute / Substitute whole line
* `p/P` - Paste after / Paste before
* `r/R` - Replace char / Replace mode
* `~` - Toggle case
* `>>` / `<<` - indent
* `J` - Join lines

# Nouns

* `w` - word
* `W` - WORD (can include or exclude special characters)
* `s` - sentence
* `p` - paragraph
* `b` - block
* `t` - tag
* `() {} <> []` - block in brackets
* `"" '' `` ` - quoted string

# Modifiers (and motions)

* `w/W` - word
* `e/E` - word back
* `a` - around
* `i` - inside
* `t` - till
* `f` - find
* `0` - beginning of line
* `$` - end of line
* `gg` - beginning of file
* `G` - end of file

# Adverbs

* Directions:
- arrow keys (BAD!)
- `hjkl` (Stay in home row!)
* Counts:
- number keys before actions
* Visual selection:
- `v` - regular selection
- `V` - line selection
- `<c-v>` - block selection
* Search:
- `/` forward regex search
- `?` backward regex search
>>
>>60301513
cont.
# Repeating & Macros

**The most powerful action in Vim grammar is `.` (dot).**

Repeat any sentence constructed using Vim grammar with one key press.

* Repeat support for plugins: <https://github.com/tpope/vim-repeat>

### Macros

* `q<reg>` - start and end recording macro in register, end with `q`
* `@<reg>` - run recorded macro

All macros are recorded in regular registers,
like any cut or copied text, and can be pasted and modified.

* `"ap` - paste contents of register a here
* `"ayy` - copy current line to register a

# Commands

* Regex Substitution:
* `:%s/\v(\d+)/<\1>/g` - enclose all digits in file in `<>` brackets
* `:%s//thing/g` - replace all instances of last search with `thing`
* `:%s##thing#g` - use different dividers: `@`, `$`, any non-alphanumeric char
* `:help substitute`

* Global Commands:
* `:g/^TEXT/m $` - move all lines mathcing `/^TEXT/` to the end of file
* `:g/^TEXT/c 't` - copy all lines mathcing `/^TEXT/` to the `'t` mark
* `:g/^TEXT/normal "Ayy` - append every line matching`/^TEXT/` into `A` register
* `:help global`

* Buffer Commands:
* `:bufdo %s/TEXT//g` - remove all occurences of **TEXT** from all open buffers
* `:argdo g/TEXT/y R` - append all lines matching **TEXT** into register `r` from all buffers in the `args` list


Maybe this should be in a pastebin and in the OP no that I think
>>
>>60298166
gg, G
>>
>>60299005
In a directory, you wouldn't use vim but find, sed, and awk.
>>
>>60301627
What about doing that from vim? Is there any hack you can put in vimrc to do this automatically?
>>
>>60298146
>to use as little plugins as possible
This.

Vimscript is an abomination and bringing in complex plugins written in it degrades Vim.
>>
>>60299108
I've found "vim modes" in other IDEs are fucking awful. they emulate the shortcuts, and do a passable insert/normal mode combo, but they completely fail to realize the true power of vi's modal editing and UI.
>>
>>60300565
I'm using it. Pretty comfy except sometimes it overrides your init file, so you have to do retarded shit to override the override.
>>
>>60298808
>he doesn't disable simple navigational keys to force the use of more efficient ones
pleb
>>
I use emacs because I don't like being told I should donate to uganda kids.
>>
>>60301753
kek, I prefer GPL myself and lisp is what vim needs, but until someone makes a vi with lisp implementation or vile has more support, vim it is
>>
>>60301799
Any decent language would be fine, honestly.
>>
>>60301579
Thanks, wp G
>>
File: 1493988683181.jpg (56KB, 529x909px) Image search: [Google]
1493988683181.jpg
56KB, 529x909px
What's the best auto-complete plugin?
>>
>>60298166
The way i remember is to think of the document like a water well

>to get a bucket of water all the way to the top, your arms make several small repeated pulls (gg)

>to get to the bottom of the well you make one big jump and it makes a loud splash (G)
>>
>>60301896
Deoplete by far
>>
>>60302254
That's for neovim tho
>>
>>60297909
I use SublimeText
Also, do you /g/ays mingle with Neovimers?
>>
>>60301896
I always had trouble with building youcompleteme. and it's huge and ungainly.
Today I'm using mu-complete and it's fine for my needs.
It's also written in vimscript and doesn't contain as much external code
>>
>>60300169
>shitloads of plugins and ricing
>for something any modern editor can do
>>
>>60304149
This

I used to use YCM and recently switched to mu-complete as well and it's so much more pleasant.
>>
>>60304236
>>60304149
Thank you!
>>
Is cream allowed?
>>
>>60302254
>>60304149
why not vimcompleteme?
>>
>>60297909
where is the guide to achieve comfiness?
>>
File: 2017-05-10-112753_1882x85_scrot.png (22KB, 1882x85px) Image search: [Google]
2017-05-10-112753_1882x85_scrot.png
22KB, 1882x85px
this is so useful and only learnt about this 2 days ago ;-;
also how do you remove the highlighted words after completing the search
>>
Emacs is a good operating system.
Too bad it lacks a proper text editor
>>
>>60305724
To turn it on, it's :set hlsearch
To turn it off, it's probably :set hlsearch! or :set nohlsearch
To take highlighting away away it's :nohl
>>
File: 1494009961651.png (239KB, 696x720px) Image search: [Google]
1494009961651.png
239KB, 696x720px
How would I delete every line with "Hello" in it?
>>
>>60306363
:g/Hello/d
>>
I just like the default. I mean, Vim has a shit ton of features and I feel like the ones that aren't enabled by default are subjective. Vim even has fucking mouse support. I don't use it, but it's there if you want it.
>>
do you people really need a general for this shit
>>
>>60301666

Nice satanic trips..


I think it's a journey:

>Beginner:
>Vim is used as a YSWYG text editor with fancy shortcuts

"how do I move to a certain line?"
"how can I cut this and paste this here?"
"how can I replace text?"


>Intermediate:
>Understanding the different modes

"Nice, I can do all this stuff without using insert mode.."


>Advanced:
>Using macros and plugins, using tabs and splitscreens

"Why should I bother with parentheses?"
"Sweet, I can yank this whole text block!"

>Pro:
>Editing your vimrc, writing Vimscript

"It's super comfy to just use my favorite shortcuts."


>Power user:
>Starting to "speak" Vim, understanding Ed/Ex commands

"I just realized I don't need this custom keybinding, when I can just have the same result with this little shortcut here."

"This line means: For every line that contains parentheses and 'static void', I want to insert my interface before the opening brace - but only for line 10-40."


>Entering the void:
>Speaking "Vim", using registers and pipes, almost no plugins or macros anymore

"Whoa, Vim is so simple, why didn't I get this before?"

"Sometimes I use some Vim one-liner from the command line to do a quick file manipulation."

"I have a few text files which insert comments and load my favorite Vim comands in my registers, so I can execute them from the registers with the @-command."
>>
>>60306363
grep -v Hello <file> > newfile
>>
is ootd vim/vi one that gives easy rsi?
>>
>>60307950

I have no Vim here, so I can't test it.

But from Vim it should be something like this:

:w | bd | ! grep -v Hello % > newfile


save file, delete buffer (=close file), run bash command (% is the current file)
>>
>>60298214
This.
Being using the gui version on desktop and keeping vim on term
>>
>>60304884
I think I tried it and it didn't work out of the box. mu did, so won by merit of comfyness
>>
>>60305652
> learn how to use vim without plugins and with a clean config
> start building config suitable for your needs
> start getting plugins
>>
>>60301646
I'm sure there is, but I just haven't found it.
>>
>>60308266
>>60301646
Actually, you would run the script using !, so like

!find ./ -type f -print0 | xargs -0 sed -i 's/search/replacement/g
>>
>>60298084
Must be tough being gay
Thread posts: 72
Thread images: 7


[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.