Automating the Vim Workplace (2020)
The article outlines automation techniques for GVim to boost productivity, emphasizing personal configurations, efficient mode switching, clipboard commands, and running Git commands, while encouraging customization for individual workflows.
Read original articleThe article discusses various automation techniques for enhancing productivity in GVim, a popular text editor among programmers. The author, Shrikant Sharat Kandula, shares personal insights and configurations that have improved his coding workflow over ten years of using GVim, particularly for Python, Markdown, and JavaScript. Key topics include switching between normal and insert modes efficiently, starting GVim maximized on Windows, saving all buffers without errors, and copying to the system clipboard with simplified commands. The author emphasizes the importance of tailoring Vim to individual work styles rather than relying solely on plugins. Other notable configurations include ensuring directories exist before saving files, switching between alternate buffers, and running Git commands directly within Vim. The article encourages readers to identify their own repetitive tasks and create custom mappings to streamline their workflow, ultimately transforming Vim into a more effective workplace.
- The author shares personal configurations to enhance productivity in GVim.
- Emphasis is placed on customizing Vim to fit individual work styles.
- Key automation techniques include efficient mode switching and simplified clipboard commands.
- The article encourages identifying repetitive tasks for potential automation.
- Running Git commands directly within Vim is highlighted as a productivity booster.
Related
My (Neo)Vim workflow
An experienced Vim user shares tips on optimizing the (Neo)Vim experience through Personalized Development Environment (PDE), covering search techniques, keybindings, plugins, movement enhancements, text manipulation, quickfix list, spell check, and status line customization.
Wonderful Vi
The vi text editor, created in 1976, influences modern editors like Vim and Neovim, emphasizing efficient command structures. New users are encouraged to learn basic commands for better productivity.
Wonderful Vi
The article highlights the lasting impact of the vi text editor, emphasizing its efficient command structure, learning curve, and recommending Neovim for beginners, while celebrating its continued relevance in modern editing.
What Is Vim?
Vim is a text editor recognized for its efficient command structure, influencing mainstream editors. (Neo)vim is its most complete version, with alternatives like Zed and Emacs available for users.
Vim is a cast iron skillet
The article compares mastering Vim, a text editor, to caring for a cast iron skillet, highlighting the efficiency gained through practice and the importance of understanding tools for productivity.
What really frustrates me is how little people seem to want to invest in their tools, or the outright lies they tell themselves about how much configuration they need to use Vim on a daily basis. My Vim config is 200 lines, and my last commit was 3 years ago. I've invested maybe a few days of my life into configuring Vim and I use it 8-16 hours a day.
Vim can do so much on its own. It has autocomplete, fuzzy finding, integration with build systems, file search, navigation using a directory browser, jump to symbol, parse compiler output to jump to bugs, support for gdb and breakpoints, a built in terminal, copy to and from the system clipboard, and with literally 8 lines of code you can get support for every linter, LSP, etc. known to man, fuzzy finding, and git integration that let's you use native git commands with seamless editor integration.
Vim can run shell commands as filters over selections as well.
Although vim does provide its own `:sort`, you can also sort the current selection like
v{motion}!sort
Which uses the external sort command (coreutils)For reversing,
v{motion}!tac
Which uses `tac` to reverse the order of the lines.This general concept is quite useful in many other ways, since it is quite universal - selection goes to stdin of arbitrary program, stdout of that program replaces selection.
For example, if you want to quickly test a function that takes a json string, and you're in a language where instantiating good mock objects and serialising it takes quite a bit of code, you can quickly make a mock by writing JS code within the string quotes and have the code console.log json and then `vi'!node` will replace it there.
nmap <F2> :silent! wa<CR>
Copy to System Clipboard if has('unix')
set clipboard=unnamedplus
else
set clipboard=unnamed
endif
Also, to type word under cursor into command line: cmap <M-w> <C-R>=expand("<cword>")<CR>
Paste without replacing clipboard (for the lazy): vnoremap p P
honestly, I like articles that are “a list of vim tips”. I can usually find some really good ideas that I didn’t consider. The tip about remapping copy to system clipboard to something easier than ‘“+y’ is genius, definitely using that.
Related
My (Neo)Vim workflow
An experienced Vim user shares tips on optimizing the (Neo)Vim experience through Personalized Development Environment (PDE), covering search techniques, keybindings, plugins, movement enhancements, text manipulation, quickfix list, spell check, and status line customization.
Wonderful Vi
The vi text editor, created in 1976, influences modern editors like Vim and Neovim, emphasizing efficient command structures. New users are encouraged to learn basic commands for better productivity.
Wonderful Vi
The article highlights the lasting impact of the vi text editor, emphasizing its efficient command structure, learning curve, and recommending Neovim for beginners, while celebrating its continued relevance in modern editing.
What Is Vim?
Vim is a text editor recognized for its efficient command structure, influencing mainstream editors. (Neo)vim is its most complete version, with alternatives like Zed and Emacs available for users.
Vim is a cast iron skillet
The article compares mastering Vim, a text editor, to caring for a cast iron skillet, highlighting the efficiency gained through practice and the importance of understanding tools for productivity.