[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / 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: 1680807554965.png (782 KB, 1920x1080)
782 KB PNG
>Vim is a text editor for Unix that comes with Linux, BSD, and macOS. It is known to be fast and powerful, partly because it is a small program that can run in a terminal (although it has a graphical interface)
>It is mainly because it can be managed entirely without menus or a mouse with a keyboard

>resources
https://www.vim.org/ (official website)
https://www.vim.org/docs.php (official documentation)
https://vimdoc.sourceforge.net/vimum.html (or you can just type vimtutor in your terminal)

>further reading
http://www.oualline.com/vim-cook.html (Vim Cookbook by Steve Oualline)
https://www.moolenaar.net/habits.html (Seven habits of effective text editing)

>i need some help with vimscript
https://learnvimscriptthehardway.stevelosh.com/ (for users of the Vim editor who want to learn how to customize Vim)

>i want some colors
https://vimcolorschemes.com/

>lsp
https://github.com/prabirshrestha/vim-lsp
https://www.vimfromscratch.com/articles/vim-and-language-server-protocol (article about LSP)

>i want some ploogins
https://vimawesome.com/

>i am gay
https://neovim.io/ (hyperextensible Vim-based text editor)
https://code.visualstudio.com/
https://www.gnu.org/software/emacs/
https://www.jetbrains.com/
>>
-run it in a TTY only system
-i am trapped
-have to cycle power supply to reboot
>>
>>109265682
To those who want something:
- vim-like
- lightweight
- scriptable

I recommend vis.
https://github.com/martanne/vis
It's like vi with Plan 9 styled structural editing.
https://www.brain-dump.org/projects/vis/
>>
>>109266416
no pics, no clicks
>>
>>109265682
Grok CLI is inspired by Vim and made for Vim users. :3
>>
Any of you know a way to ergonomically work with substitution commands? sometimes i want to write the ad-hoc substitution/seach string in the file, then yank it into whatever "/" uses.
>>
>>109267189
- In one window, have your main vim,
- and in another window, load up your file of regexps in any text editor that can copy to the system clipboard. (It could be another vim if you want.)
- Whenever you want to use a pre-made regexp, copy it from the second window into the system clipboard and paste it into your main window at the point where you're going to use it.
>>
>>109267189
Don't know if there's a way to reference the contents of a register in an expression, but I guess you could just paste it into the search or on the command line with <C-R>"
>>
File: 1781092945547049.jpg (261 KB, 1316x2190)
261 KB JPG
as a long time vim user
it is a meme
>>
File: vis.fosdem.jpg (111 KB, 1280x720)
111 KB JPG
>>109266579
https://archive.fosdem.org/2018/schedule/event/vis_editor/
>>
>>109266416
vis is probably what I'd learn if I'd change to another editor. It seems to be most similar to vim while also having the advantages of Kakoune or Helix.
I like working with lines though, they make sense. And most programming languages I've worked with seem to be structured (or can be structured) around lines. But maybe I just haven't understood the concept of structural regular expressions fully, grokked it so to speak, since I haven't tried it for any longer period.
>>
>>109266416
>>109267633
lame. all these tards are try to make their own editor which is always effectively just base vim with their config + 3 of their favorite plugins. we already have vim for idiots. its called visual studio code.
>>
>>109266416
Looks neat, but I need a make plugin.
>>
>>109267189
The @/ register isn't writable, but you can use q: or q/ to get a proper vim buffer for a command line, or use <c-f> while already in a command line.
>>
File: regexcheatsheet3.png (403 KB, 2338x1654)
403 KB PNG
Don't know if anyone's interested but I tried making a shitty cheat sheet for basic regular expressions in vim. I figured it might be useful, mostly since there's so many damn flavors of regex, and very few guides that talk about vim's specifically. So it's very basic (no lookaround, and very few character classes) but at least you can see when there should be backslashes and when not.

The grayed parts are things that can be used in vim but not in GNU BRE or GNU ERE or is written differently there (I guess technically \{M} should be \{m\} for it to be GNU BRE too, but I'm too lazy to change it now, I might later though and maybe expand it with more stuff too)

If nothing else people can tell me I should have included this and that, and then I might learn some new cool commands.
>>
>>109267570
What i do mean is, how to paste that inside the search command
>>109267599
This looks like what i want to do
>>109267813
How do i "save" the changes using q:? it looks handy.
>>109267711
Not even remotely similar really, VSCode is a bloated mess.
>>
>>109267865
>How do i "save" the changes using q:? it looks handy.
Do you mean how you commit the change? Just press <CR> when you're done.

Just a note, pressing <CR> in insert mode in the command buffer will commit the change but automatically undo the change for you for some reason. Pressing <CR> when you're in normal mode will not do that.
>>
>>109265682

Should this link be included in the OP?
https://vim-classic.org/
It's the no-LLM fork of vim.
>>
>>109268178
>Drew DeVault
Though I agree with his AI stance, isn't he the guy who tried getting Stallman removed from FSF for being a pedophile?
>>
File: whos-jewing-who.png (739 KB, 900x900)
739 KB PNG
>>109268331
I didn't follow that drama, but a little searching revealed that he was indeed that guy.
>>
>>109267865
>how to paste that inside the search command
https://superuser.com/questions/470727/how-to-paste-yanked-text-to-vim-command-line
to paste what you copied <C-r>+ also works in "/"
>>
>>109265682
is there a script or plugin to disable modes and turn keybindings into what any other text editing GUI expects?
i.e. select words with Ctrl+Shift+left, etc.
>>
>>109269345
No. Just use Nano or Micro if you want a terminal text editor without modes.
>>
>>109269345
There's Vim easy mode
vim -y
>>
File: EMAC.jpg (73 KB, 1280x720)
73 KB JPG
>>109266416
Emacs is better
>>
>>109270171
I use Emacs, too, in evil-mode. I'm just posting here to pass time.
>>
>>109266416
>>109267633
This seems interesting. However, the primary thing I like about Plan 9's editor ACME, is its ability to effortlessly integrate external tools into the editor.
Whole and real programs instead of just simply plugins. Programs that might be useful on their own even outside of the editor, compared to say a lua script using the Vim APIs.

Not that plugins, lua, or neovim are bad.
But the whole thing that made me migrate from Vim to Neovim was the fact Lua has practical applications outside of Vim, unlike VimL.
But only at the language level. Other things use Lua and you can use Lua on its own so it's at least not a waste of time to learn like VimL felt like to me (even as a lifetime Vim user).

ACME seems to push this further.
incentivizing you to make simple standalone programs that are useful for editing, and then it just lets you easily compose and plumb with them.

It's an interesting idea that I've always wanted to dive into and explore more. To evaluate the editor and the concept. But I haven't gotten around to it yet.
>>
I migrated from lazy to pack and native lsp configuration + lspconfig
but I can't get this to work
https://github.com/neovim/nvim-lspconfig#lsp-settings-type-annotations
and all the examples I find are for lazy not pack.
I don't understand since the only difference should be the path which I updated from the lazy install location to the pack one.

---@type vim.lsp.Config
return {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = { '.luarc.json', '.luarc.jsonc' },
---@type lspconfig.settings.lua_ls
settings = {
Lua = {
runtime = {
version = 'LuaJIT'
},
diagnostics = {
globals = { 'vim', 'lspconfig' }
},
workspace = {
library = {
vim.env.VIMRUNTIME,
vim.fn.stdpath("data") .. "/site/pack/core/opt/nvim-lspconfig"
}
}
}
}
}


Is anyone else using pack with lspconfig and if so how are you doing this?
I want to be able to validate my lsp config settings and get all the other shit that comes with it like autocomplete and documentation for LSP configuration fields, etc.

I can't figure out why it's not able to find the annotations like: `---@type lspconfig.settings.lua_ls`
>>
>>109267966
>>109269102
I get it now, thanks, had a long shift yesterday.
>>109269833
Is a bit pointless to cover the use case if you need to configure a keybind, or directly use <C-o> + the actual quit command to close it. Fun curiosity though.
>>
>>109272239
><C-o> + the actual quit command to close it.
For some reason I can use <C-q> to quit vim easy mode on my phone, but not when I try it on my computer. Don't know if it depends on the version or default configs with different distributions. Ironically my phone has a higher vim version than my computer.

But yeah I wonder who's it for. Maybe it could be used if someone else needs to borrow your computer and edit something.
>>
>>109273656
>For some reason I can use <C-q> to quit vim easy mode on my phone, but not when I try it on my computer
What? I'm using Bug-untu's Vim version for what is worth, and easy mose through <C-q> doesn't work.
>But yeah I wonder who's it for. Maybe it could be used if someone else needs to borrow your computer and edit something
If they did it just for the joke I call it based, but one practical use in my mind is lending over a toy environment to some kid in a ComptiA+++ tier course.
>>
>>109274723
Try ^w^q, but it doesn't 'exit'. it closes the current window, which might exit vim if there's only one window active.
>>
>>109274723
>>109274870
<C-q> to quit seems to be in newer versions
https://vimhelp.org/starting.txt.html#evim-keys

I checked the help pages in my version 8 vim, and it doesn't have it. Which is crazy that they didn't put it in from the start. It's like a cruel joke, making it even more difficult to quit when you're running "easy-mode".
>>
>>109271801
You should debug your luals lsp setup.
make sure it's correctly started with the settings in your config
>>
>>109275033
Looks like easy mode/evim primarily was made to be used with the GUI, where you can quit by using the menus:
https://github.com/vim/vim/issues/10385
>>
>>109265682
>i am gay
Yeah, your meme text editor literally begs you to donate to niggers with AIDS in Uganda. Kek.
>>
>>109275172
It works for everything in Lua except for the lspconfig type annotation:
`---@type lspconfig.settings.lua_ls`
the built in one:
`---@type vim.lsp.Config`

Does work. And so do completions for `vim.` Which I think implies the config is working since it detects the vim.env.VIMRUNTIME + vim globals.

"'lspconfig'" wasn't meant to be in globals. But it doesn't seem to resolve it either way.

I wasn't sure if I needed to target the root or the lua directory specifically
"/site/pack/core/opt/nvim-lspconfig/lua"
and this also doesn't change anything.

I have no idea what's going on.
The directory exists and the config is being applied, and it works for the runtime element but not the lspconfig one. Can't figure out where the problem lies. Really confused and out of moles to whack.
>>
>>109275224
bram moolenaar paid the vax tax for his sin of believing the jews and their lies.
>>
>>109265682
You forgot this: https://vimuser.org/
>>
>>109265682
for all you autists: https://www.vimgolf.com/
the levels of autism in the field of vim golfing are insane
>>
>>109278809
Ok, that is a good one
>>
>>109278809
>volf
Nice.



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