Posts tagged: vim

All posts with the tag "vim"

29 posts latest post 2026-01-04
Publishing rhythm
Jan 2026 | 1 posts

python lsp setup

Setting up python with the native nvim>0.5 lsp was mr lsp-config # [1] https://github.com/neovim/nvim-lspconfig lua << EOF require'lspconfig'.pyright.setup{} EOF pyls#190 # [2] https://github.com/palantir/python-language-server/issues/190 lspconfig.pyls.setup { cmd = {"pyls"}, filetypes = {"python"}, settings = { pyls = { configurationSources = {"flake8"}, plugins = { jedi_completion = {enabled = true}, jedi_hover = {enabled = true}, jedi_references = {enabled = true}, jedi_signature_help = {enabled = true}, jedi_symbols = {enabled = true, all_scopes = true}, pycodestyle = {enabled = false}, flake8 = { enabled = true, ignore = {}, maxLineLength = 160 }, mypy = {enabled = false}, isort = {enabled = false}, yapf = {enabled = false}, pylint = {enabled = false}, pydocstyle = {enabled = false}, mccabe = {enabled = false}, preload = {enabled = false}, rope_completion = {enabled = false} } } }, on_attach = on_attach } mypy # [3] Getting mypy working with ...

Vim Wsl Clipboard

I’ve long used neovim from within windows wsl, and for far too long, I went without a proper way to get text out of it and into windows. wsl has access to cmd applications # [1] wsl can access clip.exe. You can do some cool things with it, such as cat a file into the clipboard, sending output from a command to the clipboard, or set an autocmd group in vim to send yank to the windows clipboard. using clip.exe # [2] Let’s say you want to send a teammate the tail of a log file over chat. You can tail the file into clip.exe. tail -n 1 info.log | clip.exe pipe streams of text into clip.exe make it a bit more natural # [3] I recently made mine feel a bit more natural by aliasing it to clip. alias clip=clip.exe pop this in your ~/.bashrc or ~/.zshrc yanking to windows clipboard from vim # [4] I use neovim as my daily text editor and its a pain to share code with a teammate over chat, stack overflow, into a gist, or whatever you need. The following snippet has been quite useful ...

Vim Replace Visual Star

Replacing text based on whats in the current search register is a quite handy tool that I use often. I believe I picked this tip up from Nick Janetakis, check out his YouTube channel for some amazing vim tips. https://www.youtube.com/watch?v=fP_ckZ30gbs If there is one thing that I Like most about vim it’s the ability to hack on it and make it work well for you. Replacing text in vim # [1] Vim can often be a bit verbose, but that’s ok because we can hack on it, and make our own shortcuts and keybindings. For instance, finding and replacing text requires using a command at the vim command-line :. Replacing foo with bar looks like this :%s/foo/bar/g, the final g means all of the foos, not just the first one on the line. making it better # [2] I have a keybinding in my init.vim that will allow me to search for a pattern with the usual / character, page through them as normal with n and N, but when I press <C-R> it will populate the replace command for me so that all I need to do ...
2 min read 💬 3

Save Vim Macro

If you are like me, you have created a macro or two that is pure glory, and you forget how you made it after a day or so, or you immediately want to store it away as a custom keybinding. As with most things with vim, it’s easy to do once you understand it. Creating a Macro # [1] One of the earliest things we all learn to do in vim is to create macros, custom sets of functionality stored in a register that can be replayed later. To create a macro, get into normal mode, then type q followed by a letter that you want to store the macro under. qq Note: a common throw-away macro register is q because it’s easy to hit qq from normal mode to start recording. Replaying a Macro # [2] Macros can be replayed using @ followed by the letter that you stored the macro under. @q Registers # [3] Registers are nothing more than a single character key mapping to a value of some text. As you yank, delete, or create macros in vim, it automatically stores text into these registers. When you hit...
3 min read 💬 3
Live Substitution In Neovim

Live Substitution In Neovim

Replacing text in vim can be quite frustrating especially since it doesn’t have live feedback to what is changing. Today I was watching Josh Branchaud’s Vim-Unalphabet series on Youtuve and realized that his vim was doing this and I had to have it. https://twitter.com/_WaylonWalker/status/1346081617199198210 How to do it # [1] I had to do a bit of searching and found a great post from vimcasts [2] that shows exactly how to get the live search and replace highlighting using inccomand :h inccommand # [3] 'inccommand' 'icm' string (default "") global "nosplit": Shows the effects of a command incrementally, as you type. "split" : Also shows partial off-screen results in a preview window. Works for |:substitute|, |:smagic|, |:snomagic|. |hl-Substitute| If the preview is too slow (exceeds 'redrawtime') then 'inccommand' is automatically disabled until |Command-line-mode| is done. Add this to your config # [4] I believe that this is a neovim only feature, add it into your ~...

Keep Location List Closed

Vim’s (neovim in my case) location list can provide some very useful information while developing. Mine gives me information about linting and type checking errors with fairly little config. Generally, it sits nicely at the bottom of the screen and barely affects me. Other times, especially while zoomed way in during a presentation, it just gets in the way. [1] Location List eating up the screen while I am zoomed in and trying to live code Toggling the location list # [2] Through some google search I found the culprit was syntastic. It has an auto_loc_list feature. We can turn it off by setting syntastic_auto_loc_list=0. let syntastic_auto_loc_list=0 Keybindings # [3] I want to keep the location list open automatically most of the time, but when I don’t want it to keep opening it’s generally detrimental. Trying to live code while the location list keeps taking up the whole screen is not cool. First, create a function that will toggle both the location list and syntactic toget...
1 min read

Vim Notes

vim notes nvim lua # [1] norcalli/neovim-plugin [2] nvim lsp # [3] python-lsp/python-lsp-server [4] Using c to change text # [5] I have gone quite awhile without using c and instead using d. The reason that I started using c is because it automatically places you into insert mode. This not only saves me one keystroke for commands such as diwi is now ciw, but it also works with the repeat . command!!! This is huge. When refactoring a document I had been creating a macro to change one word to another, using c instead of d allows the use of the . rather than needing to create a macro. Case for vim # [6] Sublime/VSCode cannot - edit a macro register - register - quickfix - gF autocomplete # [7] repeats previously typed text 1. Whole lines |i CTRL-X CTRL-L| 2. keywords in the current file |i CTRL-X CTRL-N| 3. keywords in 'dictionary' |i CTRL-X CTRL-K| 4. keywords in 'thesaurus', thesaurus-style |i CTRL-X CTRL-T| 5. keywords in the current and included files |i CTRL-X CTRL...
2 min read