<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Volker B. Duetsch</title>
    <description>The latest articles on DEV Community by Volker B. Duetsch (@vbd).</description>
    <link>https://dev.to/vbd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F26317%2F2cb19454-882c-4e13-923d-9aaf72d69b6e.jpg</url>
      <title>DEV Community: Volker B. Duetsch</title>
      <link>https://dev.to/vbd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vbd"/>
    <language>en</language>
    <item>
      <title>Some Vim snippets from my workflow</title>
      <dc:creator>Volker B. Duetsch</dc:creator>
      <pubDate>Wed, 11 Jun 2025 14:27:43 +0000</pubDate>
      <link>https://dev.to/vbd/some-vim-snippets-from-my-workflow-1054</link>
      <guid>https://dev.to/vbd/some-vim-snippets-from-my-workflow-1054</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;There exist a lot of introductions to Vim. So I avoid writing another one. I want to share some information that helps me in my workflow and a small part of customizing.&lt;/p&gt;

&lt;p&gt;Everyone should be able to use the tools that are best suited to their individual way of working. For all kind of writing stuff, for me, it's Vim. Bram I miss you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add words to own/specific spell file
&lt;/h2&gt;

&lt;p&gt;Define your own spell file in your .vimrc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set spellfile=d:/apps/vim/spell.add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;zg&lt;/code&gt; the word under the cursor is added to &lt;code&gt;spell.add&lt;/code&gt; file.&lt;/p&gt;




&lt;h2&gt;
  
  
  Auto commit a file to an existing repo, if you write it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;autocmd BufWritePost d:/projects/my/wiki/* execute '!git add % &amp;amp;&amp;amp; git commit -m "Automatic commit: % by Vim"'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every time I write a file to &lt;code&gt;d:/projects/my/wiki&lt;/code&gt; it will automatically be committed to the existing repo.&lt;br&gt;&lt;br&gt;
The &lt;code&gt;%&lt;/code&gt; in "Automatic commit: % by Vim" will be replaced with the filename.&lt;/p&gt;


&lt;h2&gt;
  
  
  Dictionaries for technical terms
&lt;/h2&gt;

&lt;p&gt;I write almost everything exclusively in Vim. I have often to deal with technical terms or project related terms, so I use several dictionaries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set dict=d:/apps/vim/terms_p1.txt
set dict+=d:/apps/vim/own_tags.txt
set complete+=k
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;terms_p1.txt holds terms specific to my current project (p1).&lt;/li&gt;
&lt;li&gt;own_tags.txt holds special terms/tags I often use.&lt;/li&gt;
&lt;li&gt;set complete+=k is needed to complete the terms with ctrl-n&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Dictionaries allow only words without spaces, one word per line.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Find out where a key mapping comes from
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;:verbose map gx&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Show current mode by color of statusline
&lt;/h2&gt;

&lt;p&gt;I use orange for normal mode and green for insert mode.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;au BufEnter * hi statusline guifg=black guibg=orange
au InsertEnter * hi statusline guifg=black guibg=green
au InsertLeave * hi statusline guifg=black guibg=orange
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  My customized status line
&lt;/h2&gt;

&lt;p&gt;I know there are several great plugins, but I try to depend on as little as possible plugins.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set laststatus=2                                    " always show statusline
set statusline=
set statusline+=%{StatuslineMode()}
set statusline+=\ %h%m%r%w                          " flags
set statusline+=\ %F                                " path and filename
set statusline+=\ \-\-\ %l:%L\ \-\-\ %p%%\ \        " line from lines, in %
set statusline+=\ \-\-\ Col\ %c                     " 2 spaces, column number
set statusline+=\ \-\-\ Bn\ %n                      " Buffer number
set statusline+=%=                                  " right align
set statusline+=\FT\:\%{strlen(&amp;amp;ft)?&amp;amp;ft:'none'},    " filetype
set statusline+=\ \ENC\:\%{strlen(&amp;amp;fenc)?&amp;amp;fenc:&amp;amp;enc}, " encoding
set statusline+=\ \FF\:\%{&amp;amp;fileformat},               " file format
set statusline+=\ \%{wordcount().words}\ words,         " number of words
set statusline+=\ \%L\ lines,         " number of lines
set statusline+=\ size\:\ \%{getfsize(expand(@%))}

function! StatuslineMode()
  let l:mode=mode()
  if l:mode==#"n"
    return "NORMAL"
  elseif l:mode==?"v"
    return "VISUAL"
  elseif l:mode==#"i"
    return "INSERT"
  elseif l:mode==#"R"
    return "REPLACE"
  elseif l:mode==?"s"
    return "SELECT"
  elseif l:mode==#"t"
    return "TERMINAL"
  elseif l:mode==#"c"
    return "COMMAND"
  elseif l:mode==#"!"
    return "SHELL"
  endif
endfunction
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The function is not from me. I don't remember where I got it from. Thanks to the developer.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Vim and shell
&lt;/h2&gt;

&lt;p&gt;Will pipe the output to vim:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- fd PATTERN | vim -
- rg PATTERN | vim -
- curl -s https://example.com | vim -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Convert a diff to HTML
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;:TOhtml&lt;/code&gt; most people probably know.&lt;br&gt;
The command creates a new buffer with the buffer content of the buffer from which the command was called, converted to HTML.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim -d file1.go file2.go +TOhtml +"w diff.html" +qa!

vim -d file1.go file2.go -- starts vim in diff mode for file1.go and file2.go 
+TOhtml                  -- convert to html
+"w diff.html"           -- write in file diff.html
+qa!                     -- close all buffers and exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Let Vim write
&lt;/h2&gt;

&lt;p&gt;No snippet-plugin or abbreviation is used! I can't remember when for which task I used this, maybe just because it is possible.&lt;/p&gt;

&lt;p&gt;Of course also works with echo, cat, bat, etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim +"normal iHello" +"w n.txt" +q

vim +"normal iHello" -- will start Vim and type Hello
+"w n.txt"           -- will write current buffer to file n.txt
+q                   -- will close Vim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Folding
&lt;/h2&gt;

&lt;p&gt;I use folding by marker. Default marker is {{{ and }}}. If you don't like the default you can try something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set foldmethod=marker
set fmr=▶▶▶,◀◀◀
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Use a fixed set of emojis
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ab :fr: 👉
ab :fl: 👈
ab :fh: 👍
ab :gk: 🟩
ab :rk: 🟥
ab :yk: 🟨
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just type &lt;code&gt;:fr:&lt;/code&gt; followed by space and the emoji will show up&lt;/p&gt;

&lt;p&gt;I'm not a big fan of emojis so for my personal documents I like to decide to get rid of one or another.&lt;br&gt;
To search for them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:vimgrep /[^\x00-\x7F]/g %
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result can be found in the quickfix list, use &lt;code&gt;:copen&lt;/code&gt; to open it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Indent and out dent
&lt;/h2&gt;

&lt;p&gt;For writing my outlines I need this often.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In insert mode:
ctrl-t -- indent
ctrl-d -- out dent

In normal mode:
&amp;gt;&amp;gt; -- indent
&amp;lt;&amp;lt; -- out dent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For my Golang coding I mostly rely on go fmt.&lt;/p&gt;

&lt;p&gt;For other languages &lt;code&gt;gg=G&lt;/code&gt; and &lt;code&gt;&amp;gt;i}&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Moving lines to marks
&lt;/h2&gt;

&lt;p&gt;Define a mark &lt;code&gt;m&lt;/code&gt; by typing &lt;code&gt;mm&lt;/code&gt; in normal mode.&lt;/p&gt;

&lt;p&gt;Now you can do something like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:.,+1m'm

.,+1 -- current line plus 1 following line
m    -- move
'm   -- to mark labled m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:m0           -- move current line to begin of buffer
:m$           -- move current line to end of buffer
:g/PATTERN/m$ -- move all lines matching PATTERN to the end of buffer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Other useful stuff
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:g:PATTERN:d -- delete all lines containing PATTERN
:v:PATTERN:d -- delete all lines NOT containing PATTERN

:g:PATTERN:d is similar to :g/PATTERN/d 
but with : instead of / you often can save 
the need to escape special chars.

:g/pattern1/,/pattern2/d -– delete all lines between PATTERN1 and PATTERN2
:%normal A;              –- adds ; to the end of every line
:%normal I//             -– adds // to the beginning of every line
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;








&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;g+        -- "Time machine": go to newer text state.
g-        -- "Time machine": go to older text state.
gM        -- go to the middle of the line that is visible
gJ        -- Join the next **line** without space
dH        -- delete from cursor position to top of the screen / not buffer
dM        -- delete from cursor position to middle of the screen / not buffer
dL        -- delete from cursor position to bottom of the screen / not buffer
d/PATTERN -- delete from cursor position to position before PATTERN is matched
ctrl-6    -- switch between two buffers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Helpful resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I think it's the best doc I've ever found to exist for a piece of software. You only need to now for what to search...: &lt;a href="https://vimhelp.org/" rel="noopener noreferrer"&gt;https://vimhelp.org/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Vim Commands: A Beginner Guide with Examples: &lt;a href="https://thevaluable.dev/vim-commands-beginner/" rel="noopener noreferrer"&gt;https://thevaluable.dev/vim-commands-beginner/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A Vim Guide for Intermediate Users: &lt;a href="https://thevaluable.dev/vim-intermediate/" rel="noopener noreferrer"&gt;https://thevaluable.dev/vim-intermediate/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A Vim Guide for Advanced Users: &lt;a href="https://thevaluable.dev/vim-advanced/" rel="noopener noreferrer"&gt;https://thevaluable.dev/vim-advanced/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A Vim Guide for Adept Users: &lt;a href="https://thevaluable.dev/vim-adept/" rel="noopener noreferrer"&gt;https://thevaluable.dev/vim-adept/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A Vim Guide For Veteran Users: &lt;a href="https://thevaluable.dev/vim-veteran/" rel="noopener noreferrer"&gt;https://thevaluable.dev/vim-veteran/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A Vim Guide For Experts: &lt;a href="https://thevaluable.dev/vim-expert/" rel="noopener noreferrer"&gt;https://thevaluable.dev/vim-expert/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;For basics: &lt;a href="https://dev.to/arunkrish11/vim-is-gem-3kh7"&gt;https://dev.to/arunkrish11/vim-is-gem-3kh7&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Text objects: &lt;a href="https://dev.to/thinhkhang97/vim-key-combinations-to-change-text-2apc"&gt;https://dev.to/thinhkhang97/vim-key-combinations-to-change-text-2apc&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;To get some ideas what is possible: &lt;a href="https://dev.to/zanepearton/vim-text-editor-15-must-know-commands-for-developers-29n7"&gt;https://dev.to/zanepearton/vim-text-editor-15-must-know-commands-for-developers-29n7&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Romain Lafourcade Vim-related gists: &lt;a href="https://gist.github.com/romainl/4b9f139d2a8694612b924322de1025ce" rel="noopener noreferrer"&gt;https://gist.github.com/romainl/4b9f139d2a8694612b924322de1025ce&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Idiomatic vimrc: &lt;a href="https://github.com/romainl/idiomatic-vimrc" rel="noopener noreferrer"&gt;https://github.com/romainl/idiomatic-vimrc&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Some more notes on Vim can also be found in my field notes: &lt;a href="https://github.com/vbd/Fieldnotes/blob/main/vim.md" rel="noopener noreferrer"&gt;https://github.com/vbd/Fieldnotes/blob/main/vim.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Imho best YouTube video: How to Do 90% of What Plugins Do (With Just Vim): &lt;a href="https://www.youtube.com/watch?v=XA2WjJbmmoM" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=XA2WjJbmmoM&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Whoami
&lt;/h2&gt;

&lt;p&gt;In more than 30 years in IT project support and software development, I have taken on numerous roles, e.g. developer, lead developer, troubleshooter, "care taker", head of xxx, Scrum Master, Product Owner, project manager, moron on duty etc. - from conception to implementation.&lt;/p&gt;

&lt;p&gt;I'm using Vim since ~1997.&lt;/p&gt;

&lt;p&gt;I have seen many programs come and go. Vim has always been there. I have never regretted learning Vim. And I am still learning something new. There is only one thing you should avoid: adjust your Vim config daily ;)&lt;/p&gt;

&lt;p&gt;I'm slowly publishing my expierences as dev to GitHub converting projects notes etc. sitting in paper and several large text and markdown files. If you like check to out my field notes: &lt;a href="https://github.com/vbd/Fieldnotes" rel="noopener noreferrer"&gt;https://github.com/vbd/Fieldnotes&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vim</category>
      <category>workflow</category>
      <category>tips</category>
      <category>productivity</category>
    </item>
    <item>
      <title>What’s the Golang Pareto for an Golang developer?</title>
      <dc:creator>Volker B. Duetsch</dc:creator>
      <pubDate>Sat, 28 Oct 2023 11:11:23 +0000</pubDate>
      <link>https://dev.to/vbd/whats-the-golang-pareto-for-an-golang-developer-58nl</link>
      <guid>https://dev.to/vbd/whats-the-golang-pareto-for-an-golang-developer-58nl</guid>
      <description>&lt;p&gt;A few days ago I read the post &lt;a href="https://www.reddit.com/r/vim/comments/17ffelc/whats_the_vim_pareto_for_an_it_professional/"&gt;"What’s the VIM Pareto for an IT professional?"&lt;/a&gt; on reddit and it gave me the idea to ask exactly the same for Golang. &lt;/p&gt;

&lt;p&gt;I am aware that many things depend on the developer's area of responsibility. The answer of a CLI/TUI developer looks different than someone who writes microservices or web applications or desktop applications. I would just be interested in your answer, maybe with a small addition of what you focus on developing.&lt;/p&gt;

&lt;p&gt;Which modules of the standard library and additional libs do you think of or what from &lt;a href="https://roadmap.sh/golang"&gt;Golang roadmap&lt;/a&gt; belongs to the 20% of Golang to do 80% of the Golang dev's tasks in your opinion?&lt;/p&gt;

&lt;p&gt;Thank you for your answer!&lt;/p&gt;

</description>
      <category>go</category>
      <category>development</category>
    </item>
  </channel>
</rss>
