An open API service indexing awesome lists of open source software.

https://github.com/nylander/vim

My setup for vim
https://github.com/nylander/vim

Last synced: 4 months ago
JSON representation

My setup for vim

Awesome Lists containing this project

README

          

# My .vim folder

- Last modified: 2025-10-31 11:27:56
- Sign: Johan Nylander

---

*Vim isn't an editor designed to hold its users' hands. It is a tool, the use
of which must be learned.*

---Bram Moolenaar (author of vim)

---

## Description

Reasonable setup for efficient work with the [VIM - Vi IMproved text
editor](https://www.vim.org/). In particular, I use settings for the
"graphical vim" (`gvim`).

Oct 2025: I'm using **gvim v.9.1**

## Current file structure

vim/
├── pack
│ └── plugins
│ ├── opt
│ │ └── vim-game-code-break
│ └── start
│ ├── copilot.vim
│ ├── csv.vim
│ ├── editorconfig-vim
│ ├── LargeFile.vim
│ ├── sketch.vim
│ ├── taglist.vim
│ ├── vim-instant-markdown
│ ├── vim-snakemake
│ ├── vim-template
│ └── vimwiki
├── README.md
└── vimrc

To setup on a new machine, see the [Replication...
section](#replicating-the-repository-on-a-new-machine) below.

## Notes

### File `vimrc`

`~/.vimrc` is a symbolic link to `~/.vim/vimrc`.

There are also a lot of *comments* in the [vimrc](vimrc) worth reading.

### Additions and plugins/submodules

1. Clone a plugin directory in `~/.vim/vimrc/pack/plugins/start`, or in
`~/.vim/vimrc/pack/plugins/opt`.

For example:

$ git clone https://github.com/vim-scripts/taglist.vim.git \
~/.vim/pack/plugins/start/taglist.vim

2. Open `vim` and execute

:helptags ~/.vim/pack/plugins/start/taglist.vim

If you put the plugin (say, `foo`) in `~/.vim/vimrc/pack/plugins/opt`, it is
*not* loaded at runtime but can be added by using the command `:packadd foo`.

- Remove submodule

$ git submodule deinit pack/plugins/start/foo
$ git rm -r pack/plugins/start/foo
$ rm -rf .git/modules/pack/plugins/start/foo

- Update submodules

$ git submodule update --recursive --remote

Then add and commit any new changes, followed by push. If I need to make
changes in submodule files, I do it from my own fork of the submodule (adding
submodule as examples below).

#### Submodules used

\footnotesize

mkdir -p $HOME/.vim/pack/plugins/{start,opt}
cd $HOME/.vim
git submodule add https://github.com/chrisbra/csv.vim.git pack/plugins/start/csv.vim
git submodule add https://github.com/suan/vim-instant-markdown.git pack/plugins/start/vim-instant-markdown
git submodule add https://github.com/ivan-krukov/vim-snakemake.git pack/plugins/start/vim-snakemake
git submodule add https://github.com/vim-scripts/sketch.vim.git pack/plugins/start/sketch.vim
git submodule add https://github.com/Maxlufs/LargeFile.vim.git pack/plugins/start/LargeFile.vim
git submodule add https://github.com/vim-scripts/taglist.vim.git pack/plugins/start/taglist.vim
git submodule add https://github.com/nylander/vim-template.git pack/plugins/start/vim-template
git submodule add https://github.com/vim-scripts/vimwiki.git pack/plugins/start/vimwiki
git submodule add https://github.com/johngrib/vim-game-code-break.git pack/plugins/opt/vim-game-code-break
git submodule add https://github.com/github/copilot.vim.git pack/plugins/start/copilot.vim
git submodule add https://github.com/editorconfig/editorconfig-vim.git pack/plugins/start/editorconfig-vim

\normalsize

## Replicating the repository on a new machine

(Note: partly untested!)

We will clone the vim directory and then symlink to `$HOME/.vim` (and
`$HOME/.vim/vimrc` to `$HOME/.vimrc`). One alternative is to clone the repo
directly to `$HOME/.vim`, and link/copy the `.vim/vimrc` to `$HOME/.vimrc`.

1. Install prerequisites (see also step 5.)

$ sudo apt install vim-gui-common exuberant-ctags

2. Clone the repository (recursively to clone plugins as well).

$ git clone --recurse-submodules -j8 https://github.com/nylander/vim.git
$ cd vim

3. Generate helptags for plugins:

$ vim
:helptags ALL

4. Symlink to .vim and .vimrc:

$ ln -sf $PWD/vim $HOME/.vim
$ ln -sf $PWD/vim/vimrc $HOME/.vimrc

5. See the file [vimrc](vimrc) for *additional programs* required for full
functionality. This involves both installing using package managers or
manually installing from the internet (github).

6. Specific changes (work in progress)
- [ ] Need to override automatic filetype recognignition made by the CSV plugin (remove `*.dat`, add `*.tsv`)
- [ ] Make sure I use my own [templates](myfiles/templates/)
- [ ] ...

### Links

-
-