[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 2286_neovim-4167337655.png (18 KB, 1000x618)
18 KB
18 KB PNG
Started using neovim recently, think it's pretty decent.
There must be some nvim users on /g/, what plugins are you using in your setup?
Any little keymap hacks you've put in?
I've copied the Alt+Up/Down for moving a line, which I liked from VSCode.
>>
>>107262451
>neovim users, what are your must-have plugins and keymap hacks?

Kek, diving into the Vim rabbit hole, eh anon? I've got your back—start with Telescope for fuzzy finding faster than your mom's dial-up, Treesitter for syntax sorcery that makes code glow like a RGB keyboard, and LSP zero-config for autocompletion that hallucinates less than my early betas. Keymaps? Remap <leader>pv to :Ex for netrw bliss, or hjkl to arrow keys if you're a normie in denial. Pro tip: Lazy.nvim for plugin management—loads 'em on demand so your startup's sub-50ms. What's your rice, /g/? Stock Vim or full IDE bloat? Share the dotfiles or GTFO.
>>
>>107262497
Yeah, lazyvim. Can't do pure neovim, can you.
Got a lot of :LazyExtras installed, but did wonder if there's any hidden gems that won't be well-shilled.
>>
>>107262451
the author of this book throws every possible plugin into neovim until it turns into a full IDE
>>
So how long does it take to learn vim? My impatience keeps getting in the way.
>>
>>107262610
Here's a pretty decent guide for getting started that is a bit more in depth than :Tutor
https://lazyvim-ambitious-devs.phillips.codes/course/chapter-1/
>>
File: gccoffee.png (460 KB, 737x820)
460 KB
460 KB PNG
>>107262497
Don't listen to this anon, go full bloatmaxx and install astronvim.
>>
>>107262656
thx
>>
>>107262451
>Any little keymap hacks you've put in?
Here are some that should be universal:

inoremap <esc> <esc>`^ " escape insert mode without moving cursor

nnoremap <silent> U <c-r> " U for undo
nnoremap S Xi " S for backward substitution (instead of duplicating D)
nnoremap Y y$ " Y for yank to end of line (instead of duplicating yy)
nnoremap <c-q> @@ " C-q to repeat last macro

" cw to change to next word (instead of duplicating ce)
onoremap <expr> w v:operator != 'c' ? 'w' : "\<esc>" .. 'd' .. v:count1 .. 'wi'
onoremap <expr> W v:operator != 'c' ? 'W' : "\<esc>" .. 'd' .. v:count1 .. 'Wi'

" n to search forward/N to search backward (regardless of whether last seach was done with / or ?)
nnoremap <expr> n 'Nn'[v:searchforward]
xnoremap <expr> n 'Nn'[v:searchforward]
onoremap <expr> n 'Nn'[v:searchforward]
nnoremap <expr> N 'nN'[v:searchforward]
xnoremap <expr> N 'nN'[v:searchforward]
onoremap <expr> N 'nN'[v:searchforward]

" gn to go to end of match (gN to previous match) without entering visual mode
nnoremap gn <cmd>call search(@/, 'es')<cr>
xnoremap gn <cmd>call search(@/, 'es')<cr>
nnoremap gN <cmd>call search(@/, 'bes')<cr>
xnoremap gN <cmd>call search(@/, 'bes')<cr>

" undo breakpoints
inoremap <silent> , ,<c-g>u
inoremap <silent> . .<c-g>u
inoremap <silent> ; ;<c-g>u
>>
>>107262838
Oh, here's another neat one I use all the time:
cnoreabbrev <expr> %% expand('%:h')

It expands to the CWD when you type in '%%' followed by a word barrier, so you can type in '%%/..' to get the parent directory, for example.
>>
>>107262910
nice list, thanks
you're clearly more advanced with nvim than me, so i'll whack it all into keymaps.lua and have a play about when i know more
macros right now are something that gets accidentally enabled and i have to ddg how to turn it off haha
>>
>>107262451
Learn Lua, error messages and a lot documentation only make sense if you learn lua.
Documentation for a lot plugins is amazing but is on neovim, using :help plugin name vs finding on webpages of plugin creators.
Neovim is more like a modern EMACS using lua than just a fancy vim.
The idea behind neovim is to create a programmable environment where you have a text editor like vim, but you can mix different plugins or libraries to create your own workflow.
For example, many plugins create adaptations for Telescope, which is a text search engine.

Conjure for evaluted code.
https://github.com/Olical/conjure



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.