aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 4ff3a068a4a4f1114d4601fbe29a2eb0310f3a5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# VIM

This repo contains my vim configuration, hope it will be useful for you.

## Installation

You will need `vim` and `git` to be able to use this configuration.

Normally if you run the `install.sh` script it will work, but if you have a problem, try to install vim plug and check if your problem is solved.

*This vim config is expected to be cloned into `.config/vim`*

```sh
git clone https://git.arka.rocks/Oxbian/vimrc.git $HOME/.config/vim
```

**Be careful the install.sh script remove everything in `$HOME/.vim` !**

```sh
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
```

Oh and remove neovim, it make some problems with vim.

## Plugins

This config has just the necessary plugins installed:

### Themes

- [OneDark](https://github.com/joshdick/onedark.vim) onedark theme.

### Graphics utilities

- [Vim which key](https://github.com/liuchengxu/vim-which-key) show leader keybinds in a GUI.
- [Vim gitgutter](https://github.com/airblade/vim-gitgutter) to see diff between files with git.
- [Css color](https://github.com/ap/vim-css-color) preview css colors.

### LSP

- [CoC](https://github.com/neoclide/coc.nvim) a LSP plugin that work like VsCode LSP, and in Node (yeah I don't like it too but no choice...).
- [Vim Wakatime](https://github.com/wakatime/vim-wakatime) to have wakatime time tracking in vim. 


## Command & keybinds

### General

- `<leader>hl` remove highlighting

#### Window

- `Ctrl+h` move to the left window,
- `Ctrl+j` move to the bottom window,
- `Ctrl+k` move to the upper window,
- `Ctrl+l` move to the right window,

#### Buffer

- `<leader>bd` close the current buffer,
- `<leader>ba` close all the buffers,
- `<leader>bn` go to the next buffer,
- `<leader>bp` go to the precedent buffer,

#### Tabs

- `<leader>tn` open a new tab,
- `<leader>to` close all other tabs,
- `<leader>tc` close current tab page,
- `<leader>tm` move the tab after another,
- `<leader>t<leader>` go to the next tab,
- `<leader>tl` toggle between this tab and the last accessed tab,
- `<leader>te` open a new tab with the current buffer,

#### Spell check

- `<leader>ss` toggle / untoggle spellchecking,
- `<leader>sn` go to the next word to spellcheck,
- `<leader>sp` go to the previous word to spellcheck,
- `<leader>sa` add a word into the dictionary,
- `<leader>s?` show the list of alternatives for the word,

More help at `:help spell`

### Treeview

For help, use `:help netrw`.
Keybinds:
- `Ctrl+f` open the treeview buffer at the left,
- `gh` show/hide hidden files,
- `gp` change permission of local file
- `I` show netrw banner,
  
- `j/k` movement,
- `-` go up one dir,
- `<enter>` go down one dir,
  
- `d` create a directory,
- `%` create a file,
- `R` rename/move a file,
- `D` delete a file

### Vim Gutter

For help, use `:help gitgutter`.  
Keybinds:
- `<leader>hp` go to the previous hunk,
- `<leader>hn` go to the next hunk,
- `<leader>hP` to preview hunk,
- `<leader>hs` to stage hunk,
- `<leader>hu` to undo hunk,
- `<leader>ht` to toggle GitGutter.

Hunks are the difference between your file and the git file.

### LSP

For help, use `:help coc`.  
Keybinds:
- `<leader>gd` go to the definition,
- `<leader>gn` go to the next diagnostic,
- `<leader>gp` go to the previous diagnostic,
- `<leader>gr` go to the reference,
- `<leader>gR` rename element,
- `<leader>gy` type definition,
- `<leader>gi` go to implementation,
- `<leader>gh` documentation,
- `<leader>gf` format document.

## Linters & fixers

### Python

For using python linters & fixers, you will need to setup a virtual env & install the linters & fixers.

```bash
python -m venv .venv
source .venv/bin/activate
pip install python-lsp-server[all]
```

## VM

To code on a virtual machine, I use sshfs, it just mount the system of the vm on my machine and tada!  

```bash
sudo mkdir /mnt/vm
sudo sshfs -o allow_other -p 22 user@localhost:/home/user/ /mnt/vm/
```
ArKa projects. All rights to me, and your next child right arm.