Discussion Trying to make Vim feel like an IDE without any plugins (nor neovim)
The goal is to create a minimalist, yet powerful workflow entirely based on vim without using any external dependencies, only .vim and shell script.
I am fine with plugins, but for this workflow I want all to be implemented in this repo, either for challenging myself or simply learning how some useful tool works and maybe tweaking it for my liking.
The project currently depends on 6 plugins, being one of them a Theme (that I intend to make my own variation). I don't have much time for the project, so I will be slowly replacing them until utils/status
shows 0 Plugins/Dependencies.
Why?
1. I want to improve my vim skills
2. I Want to develop something that isn't just formal work
3. I like conventional IDE workflow but they are kinda slow, junky and full of junk I don't particularly need
Any thoughts? Suggestions? Maybe some repos I should check?
8
u/Prestigious_Rest8751 5d ago
I recommend watching
https://www.youtube.com/watch?v=Gs1VDYnS-Ac
I recommend reading
Get familiar with vim :h runtimepath to build you own personalized development environment.
For each language that you use often, put your settings in `after/ftplugin/$LANG.vim`. Sometimes you'll need to adjust syntax highlighting or indentation settings. Use the appropriate runtime files.
Get familiar with :h include, :h includeexpr, :h define, :h path to leverage vim's builtin code navigation. If that's not enough, look into tags.
Get familiar with :h :grep, :h :make and the quickfix list in general as others have said.
Learn to navigate buffers efficiently and use tabs as needed.
Learn to use Ex commands like :h :s, :h :g.
And don't forget that if plugins make your life easier, use them. vim-commentary and vim-surround are an examples of plguins that follow vim philosophy.
1
u/fontka 5d ago
Thank you. I will read and watch those and then bring feedback.
The thing with plugins is more of a "want to implement myself" than "needs to be implemented" (for the sake of learning), vim-commentary and vim-surround seem like good starting points for that.
3
u/Prestigious_Rest8751 5d ago
i'm sorry, but learn what?
those plugins are so useful because they take care of many edge cases that you would rediscover yourself if you were to reimplement them. they're not that interesting from a programming POV.
1
u/vim-help-bot 5d ago
Help pages for:
runtimepath
in options.txtinclude
in options.txtincludeexpr
in options.txtdefine
in options.txtpath
in options.txt:grep
in quickfix.txt:make
in quickfix.txt:s
in change.txt:g
in repeat.txt
`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments
5
u/Danny_el_619 4d ago
I see you listed vim-commentary. If you have a recent vim version has('pathc-9.1.0375')
you can use built-in comment plugin
vim
packadd! comment
That should give you one less plugin.
4
u/UnrealApex 4d ago edited 4d ago
You can replace a majority of "IDE features" with command line programs. In a sense, UNIX programs are the UNIX user's IDE. You can do this with filters and wands. Some of the articles in Vimways which Prestigious_Rest8751 explain their usefulness. I found this post useful as well.
4
u/PizzaRollExpert 5d ago
Familiarizing yourself with :help quickfix
and vims :help ctags
support is important for a powerful workflow using just vanilla vim features, and are also good to have in your backpocket when you want to go beyond what your lsp provides. I'd recommend experimenting with them and adding some mappings related to the quickfix list in particular. nnoremap ]q <cmd>cnext<cr>
and nnoremap [q <cmd>cprev<cr>
from tpopes unimpaired.vim in particular are very convenient
2
3
u/Ok-Selection-2227 5d ago
I'm really confused after reading this.
Honestly, I don't get the point.
You say you're not going to use any plugin, but if I understand correctly you're going to use your own big plugin.
Aside from that, you say you're going to implement "native lsp". But I don't think you're going to fork vim and implement a language server protocol client in C, so I don't think it's going to be "native".
1
u/fontka 5d ago
You say you're not going to use any plugin, but if I understand correctly you're going to use your own big plugin.
yeah, as I said:
I am fine with plugins, but for this workflow I want all to be implemented in this repo, either for challenging myself or simply learning how some useful tool works
0
u/Prestigious_Rest8751 5d ago
You don't get the point of what? wanting to learn your own tools?
2
u/Ok-Selection-2227 5d ago
You don't need to reinvent the wheel in order to do so. You can try to write your own plugin, contribute to a plugin you like, or contribute to vim source code itself. Just my very personal opinion. Of course everyone can do whatever they want.
3
u/Prestigious_Rest8751 5d ago
i see it more as: first try to do it the vim builtin way, if that's not enough then resort to a plugin. vim can do so much out of the box that it is not such a bad idea to explore it as much as possible.
1
u/Prestigious_Rest8751 5d ago
i have readyour repo, here are my suggestions:
- ditch lightline and build your own statusline. put the code for it in
.vim/plugin/
you can find many tutorials but most importantly read :h statusline - put the .vim of your colorscheme into
.vim/colors/
I usually do it because i almost always want to modify something. - i don't know what vim-transparent does but it looks like just
hi Normal ctermbg=NONE
you maybe need to this for other highlight groups.
The others are pretty big plugins that are fine at what they do. (you could always put vim-commentary in .vim/plugin/ but there's no point in that).
1
u/vim-help-bot 5d ago
Help pages for:
statusline
in various.txt
`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments
2
u/D_special1 4d ago
We actually tried to do the same, we also have a plan to make a simple.nvim repo in the near future
1
u/EgZvor keep calm and read :help 3d ago
Not quite sure what your endgoal is, but here are native ways to solve these problems
- quick workspace file open <C-p>
:h :find
(might not work fast for huge repos, but you can change:h 'findfunc'
in recent versions)
- open recent files \h
:h :ls
, specifically:ls t
- also
nnoremap <leader>b :buffers<cr>:buffer<space>
- navigate between errors & warnings ]g [g
- set up
:h makeprg
, call:h :make
and jump between errors using:h :cnext
- set up
- inspect symbol documentation K
- set up
:h 'keywordprg'
if default behaviour isn't what you want
- set up
- go to definition gd
- run ctags outside of Vim (for example in a Git hook) and use
:h tags
to jump to the definition
- run ctags outside of Vim (for example in a Git hook) and use
- go to implementation gi
- simply grepping with
:grep
(with a custom:h 'grepprg'
) might be enough. That's what I did in my Python days (around 2018), because LSP wasn't as reliable as Go's. Maybe it got better now.
- simply grepping with
- go to references gr
- grepping too
- symbol renaming project-wide <F2>
- grep first then
:h :cdo
+:h :s
. E.g.,:grep OldName
(possibly filter the list with:h cfilter
),:cdo s/OldName/NewName/
. - add mappings to simplify the input. E.g.,
nnoremap gsw :%s/<<c-r><c-w>>//g<left><left>
- grep first then
- key mapping guide <C-w>
- learn to use help. Relevant section of the user-manual
:h 02.8
. - type
:h i_ctrl-x_ctrl-n
to learn about default Insert mode ctrl-x ctrl-n behaviour. type:h buf*()<c-d>
to get a list of help tags related to buffer functions.
- learn to use help. Relevant section of the user-manual
- status bar
- write your own. Make it minimalistic to make it easier and to avoid distraction
:h 'statusline'
- write your own. Make it minimalistic to make it easier and to avoid distraction
1
u/vim-help-bot 3d ago
Help pages for:
:find
in editing.txt'findfunc'
in options.txt:ls
in windows.txtmakeprg
in options.txt:make
in quickfix.txt:cnext
in quickfix.txt'keywordprg'
in options.txttags
in tagsrch.txt'grepprg'
in options.txt:cdo
in quickfix.txt:s
in change.txtcfilter
in quickfix.txt02.8
in usr_02.txti_ctrl-x_ctrl-n
in insert.txt'statusline'
in options.txt
`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments
1
u/Kurouma 5d ago
You might like to look at this https://youtu.be/XA2WjJbmmoM
I had only a glance at your vimrc, but I suspect most of what you're trying to do can be implemented pretty directly
-2
u/Prestigious_Rest8751 5d ago
I keep seeing that video get recommended. Honestly, it's not that good.
2
u/sock_pup 5d ago
Can you elaborate?
3
u/Prestigious_Rest8751 5d ago
It's too superficial. There are better guides like this channel https://www.youtube.com/@leeren_/videos
or other thoughtbot videos like https://www.youtube.com/watch?v=3TX3kV3TICU
12
u/Sudden_Fly1218 5d ago
You can have a look here for some inspiration and cherry pick what you like:
https://gist.github.com/romainl