Small cleaning, update README
This commit is contained in:
parent
bdb936d1f8
commit
88b9a03093
2 changed files with 71 additions and 33 deletions
87
README.md
87
README.md
|
@ -3,7 +3,7 @@
|
||||||
I made this public so I can easily clone without authentication,
|
I made this public so I can easily clone without authentication,
|
||||||
but since I treat this as a personal use only stuff,
|
but since I treat this as a personal use only stuff,
|
||||||
there can be some(read "a lot of") messy stuff.
|
there can be some(read "a lot of") messy stuff.
|
||||||
|
|
||||||
Much of this might have been selectively copy pasted from plugin repos.
|
Much of this might have been selectively copy pasted from plugin repos.
|
||||||
Those repos are obviously listed in plugin setup part.
|
Those repos are obviously listed in plugin setup part.
|
||||||
|
|
||||||
|
@ -22,7 +22,8 @@ sudo dnf install \
|
||||||
fd-find \
|
fd-find \
|
||||||
nodejs-bash-language-server \
|
nodejs-bash-language-server \
|
||||||
tree-sitter-cli \
|
tree-sitter-cli \
|
||||||
wl-clipboard
|
wl-clipboard \
|
||||||
|
unifont-fonts.noarch
|
||||||
|
|
||||||
pip install \
|
pip install \
|
||||||
pynvim \
|
pynvim \
|
||||||
|
@ -32,13 +33,12 @@ pip install \
|
||||||
bandit \
|
bandit \
|
||||||
yapf \
|
yapf \
|
||||||
rope
|
rope
|
||||||
|
|
||||||
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
|
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
|
||||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||||
```
|
```
|
||||||
|
|
||||||
#####
|
#####
|
||||||
|
|
||||||
|
|
||||||
##### Inside vim
|
##### Inside vim
|
||||||
|
|
||||||
|
@ -47,14 +47,33 @@ sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.
|
||||||
:CocInstall coc-git coc-pyright coc-sh coc-json coc-css coc-tsserver coc-eslint coc-prettier coc-snippets coc-yaml
|
:CocInstall coc-git coc-pyright coc-sh coc-json coc-css coc-tsserver coc-eslint coc-prettier coc-snippets coc-yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Hacked font is needed to display file type icons:
|
On Fedora there is need to make sure your system can display any unicode character. Hacked fonts are needed for filetype icons but there is also need for a dedicated package with unicode fonts (like unifont-fonts.noarch) that will have every character missing from default font used in Neovim editor. Link to gacked fonts:
|
||||||
[https://www.nerdfonts.com/font-downloads](https://www.nerdfonts.com/font-downloads)
|
[https://www.nerdfonts.com/font-downloads](https://www.nerdfonts.com/font-downloads)
|
||||||
|
|
||||||
|
##### Optional stuff
|
||||||
|
|
||||||
|
perl very basic lsp server:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install perl module manager
|
||||||
|
sudo dnf install perl-App-cpanminus
|
||||||
|
|
||||||
|
# install language server module
|
||||||
|
sudo cpanm PLS
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
##### Opened files navigation:
|
##### Opened files navigation:
|
||||||
|
|
||||||
<table border="1" id="bkmrk-ctrl-w-%3Carrow%3E-movin" style="border-collapse: collapse; width: 100%; height: 178.8px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>Ctrl w w
|
<table border="1" id="bkmrk-ctrl-w-%3Carrow%3E-movin" style="border-collapse: collapse; width: 100%; height: 178.8px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td><leader> m m
|
||||||
|
</td><td>open minimap
|
||||||
|
</td></tr><tr><td><leader> m c
|
||||||
|
</td><td>close minimap
|
||||||
|
</td></tr><tr><td><leader> m f
|
||||||
|
</td><td>focus minimap
|
||||||
|
</td></tr><tr><td>Ctrl w w
|
||||||
</td><td>Move to next splitted frame
|
</td><td>Move to next splitted frame
|
||||||
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl w <arrow>
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl w <arrow>
|
||||||
</td><td style="height: 29.8px;">moving throught splitted frame
|
</td><td style="height: 29.8px;">moving throught splitted frame
|
||||||
|
@ -75,20 +94,20 @@ Hacked font is needed to display file type icons:
|
||||||
|
|
||||||
##### File explorer:
|
##### File explorer:
|
||||||
|
|
||||||
<table border="1" id="bkmrk-ctrl%2Bt-toggle-file-e" style="border-collapse: collapse; width: 100%; height: 89.4px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl+t
|
<table border="1" id="bkmrk-ctrl%2Bt-toggle-file-e" style="border-collapse: collapse; width: 100%; height: 327.8px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl+t
|
||||||
</td><td style="height: 29.8px;">Toggle file explorer when not focused on it
|
</td><td style="height: 29.8px;">Toggle file explorer when not focused on it
|
||||||
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">f
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">f
|
||||||
</td><td style="height: 29.8px;">Toggle filtering when focused on explorer
|
</td><td style="height: 29.8px;">Toggle filtering when focused on explorer
|
||||||
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;"><leader> n
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;"><leader> n
|
||||||
</td><td style="height: 29.8px;">Move focus to explorer
|
</td><td style="height: 29.8px;">Move focus to explorer
|
||||||
</td></tr><tr><td>d
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">d
|
||||||
</td><td>Delete selected file
|
</td><td style="height: 29.8px;">Delete selected file
|
||||||
</td></tr><tr><td>rn
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">rn
|
||||||
</td><td>Rename file
|
</td><td style="height: 29.8px;">Rename file
|
||||||
</td></tr><tr><td>c
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">c
|
||||||
</td><td>add file to clipboard
|
</td><td style="height: 29.8px;">add file to clipboard
|
||||||
</td></tr><tr><td>p
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">p
|
||||||
</td><td>paste (file) from clipboard
|
</td><td style="height: 29.8px;">paste (file) from clipboard
|
||||||
</td></tr></tbody></table>
|
</td></tr></tbody></table>
|
||||||
|
|
||||||
##### File searching / Telescope
|
##### File searching / Telescope
|
||||||
|
@ -96,7 +115,17 @@ Hacked font is needed to display file type icons:
|
||||||
<table border="1" id="bkmrk-%3Cleader%3Eff-find-file" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td><leader>ff</td><td>Find files
|
<table border="1" id="bkmrk-%3Cleader%3Eff-find-file" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td><leader>ff</td><td>Find files
|
||||||
</td></tr><tr><td><leader>fg</td><td>Live grep
|
</td></tr><tr><td><leader>fg</td><td>Live grep
|
||||||
</td></tr><tr><td><leader>fb</td><td>Buffers
|
</td></tr><tr><td><leader>fb</td><td>Buffers
|
||||||
</td></tr><tr><td><leader>fh</td><td>Help tags</td></tr></tbody></table>
|
</td></tr><tr><td><leader>fh</td><td>Help tags</td></tr><tr><td>Ctrl+q</td><td>Open search result list as a dedicated split (quickfix list) (will overwrite previous one created this way in current tab)</td></tr><tr><td>Ctrl+u
|
||||||
|
</td><td>Scroll preview up
|
||||||
|
</td></tr><tr><td>Ctrl+d
|
||||||
|
</td><td>Scroll preview down
|
||||||
|
</td></tr><tr><td>Ctrl+x
|
||||||
|
</td><td>Open selection as a split
|
||||||
|
</td></tr><tr><td>Ctrl+v
|
||||||
|
</td><td>Open selection as a vsplit
|
||||||
|
</td></tr><tr><td>Ctrl+t
|
||||||
|
</td><td>Open selection in new tab
|
||||||
|
</td></tr></tbody></table>
|
||||||
|
|
||||||
##### Git stuff
|
##### Git stuff
|
||||||
|
|
||||||
|
@ -108,10 +137,19 @@ Genreal git commands:
|
||||||
```bash
|
```bash
|
||||||
:Git <command>
|
:Git <command>
|
||||||
|
|
||||||
#example:
|
#Commands with dedicated display
|
||||||
|
:Git # show nice interactive summary of whole git project state
|
||||||
|
:Git mergetool, :Git difftool # load their changesets into the quickfix list
|
||||||
:Git blame # this will nicely show \
|
:Git blame # this will nicely show \
|
||||||
# for every line in separate split
|
# for every line in separate split
|
||||||
|
# Useful shortcuts for blame mode:
|
||||||
|
# o - jump to patch or blob in horizontal split
|
||||||
|
# A, C, D - different display (lenght) modes
|
||||||
|
# g? - other keybindings
|
||||||
|
|
||||||
|
#other examples:
|
||||||
:Git add .
|
:Git add .
|
||||||
|
:Git commit
|
||||||
```
|
```
|
||||||
|
|
||||||
Nice single file diff viewer:
|
Nice single file diff viewer:
|
||||||
|
@ -131,10 +169,13 @@ coc-git provides some commands for git:
|
||||||
:CocCommand git.showBlameDoc
|
:CocCommand git.showBlameDoc
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Code editing stuff
|
##### Code editing stuff
|
||||||
|
|
||||||
|
<table border="1" id="bkmrk-%3Cleader%3Ern-rename-el" style="border-collapse: collapse; width: 100%; height: 387.4px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;">w
|
||||||
<table border="1" id="bkmrk-%3Cleader%3Ern-rename-el" style="border-collapse: collapse; width: 100%; height: 298px;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr style="height: 29.8px;"><td style="height: 29.8px;"><leader>rn</td><td style="height: 29.8px;">rename element (function name, etc):</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;"><leader>ft</td><td style="height: 29.8px;">format code
|
</td><td style="height: 29.8px;">jump forward by one word
|
||||||
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">b
|
||||||
|
</td><td style="height: 29.8px;">jump backward by one word
|
||||||
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;"><leader>rn</td><td style="height: 29.8px;">rename element (function name, etc):</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;"><leader>ft</td><td style="height: 29.8px;">format code
|
||||||
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">gd
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">gd
|
||||||
</td><td style="height: 29.8px;">go to definition
|
</td><td style="height: 29.8px;">go to definition
|
||||||
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">gy
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">gy
|
||||||
|
@ -150,8 +191,8 @@ coc-git provides some commands for git:
|
||||||
</td><td style="height: 29.8px;">scroll up popup with docstring
|
</td><td style="height: 29.8px;">scroll up popup with docstring
|
||||||
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">ZZ
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">ZZ
|
||||||
</td><td style="height: 29.8px;">same as :wq
|
</td><td style="height: 29.8px;">same as :wq
|
||||||
</td></tr><tr><td>Ctrl+q
|
</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">Ctrl+q
|
||||||
</td><td>Visual block mode
|
</td><td style="height: 29.8px;">Visual block mode
|
||||||
</td></tr></tbody></table>
|
</td></tr></tbody></table>
|
||||||
|
|
||||||
##### Sessions
|
##### Sessions
|
||||||
|
|
17
init.vim
17
init.vim
|
@ -4,12 +4,13 @@ call plug#begin()
|
||||||
Plug 'kyazdani42/nvim-web-devicons' " optional, for file icons
|
Plug 'kyazdani42/nvim-web-devicons' " optional, for file icons
|
||||||
Plug 'kyazdani42/nvim-tree.lua'
|
Plug 'kyazdani42/nvim-tree.lua'
|
||||||
|
|
||||||
" neovim lsp plugins
|
" neovim lsp plugins and depencencies
|
||||||
Plug 'neovim/nvim-lspconfig'
|
Plug 'neovim/nvim-lspconfig'
|
||||||
Plug 'williamboman/mason.nvim'
|
Plug 'williamboman/mason.nvim'
|
||||||
Plug 'williamboman/mason-lspconfig.nvim'
|
Plug 'williamboman/mason-lspconfig.nvim'
|
||||||
Plug 'jose-elias-alvarez/null-ls.nvim'
|
Plug 'jose-elias-alvarez/null-ls.nvim'
|
||||||
|
|
||||||
|
" various plugins
|
||||||
Plug 'gorbit99/codewindow.nvim'
|
Plug 'gorbit99/codewindow.nvim'
|
||||||
Plug 'vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' }
|
Plug 'vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' }
|
||||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
|
@ -44,19 +45,12 @@ call plug#end()
|
||||||
" load main lua file with additional configs
|
" load main lua file with additional configs
|
||||||
lua require("general")
|
lua require("general")
|
||||||
|
|
||||||
"autocmd BufEnter *.sls :setlocal filetype=yaml
|
" highlight all .conf files as apache config (:])
|
||||||
autocmd BufEnter *.conf :setlocal filetype=apache
|
autocmd BufEnter *.conf :setlocal filetype=apache
|
||||||
|
|
||||||
"inoremap: maps the key in insert mode
|
|
||||||
"nnoremap: maps the key in normal mode
|
|
||||||
"vnoremap: maps the key in visual mode
|
|
||||||
"<C> : represents Control key
|
|
||||||
"<A> : Alt key
|
|
||||||
|
|
||||||
"nerdtree bindings
|
"nerdtree bindings
|
||||||
nnoremap <leader>n :NvimTreeFocus<CR>
|
nnoremap <leader>n :NvimTreeFocus<CR>
|
||||||
nnoremap <C-t> :NvimTreeToggle<CR>
|
nnoremap <C-t> :NvimTreeToggle<CR>
|
||||||
nnoremap <C-e> :NvimTreeFindFile<CR>
|
|
||||||
|
|
||||||
" nerdcommenter custom bindings
|
" nerdcommenter custom bindings
|
||||||
nmap <C-_> <plug>NERDCommenterToggle
|
nmap <C-_> <plug>NERDCommenterToggle
|
||||||
|
@ -66,6 +60,7 @@ vmap <C-_> <plug>NERDCommenterToggle
|
||||||
nnoremap <silent><C-s> :update<cr>
|
nnoremap <silent><C-s> :update<cr>
|
||||||
inoremap <silent><C-s> <c-o>:update<cr>
|
inoremap <silent><C-s> <c-o>:update<cr>
|
||||||
vnoremap <silent><c-s> <c-c>:update<cr>gv " gv to preserve visual selection
|
vnoremap <silent><c-s> <c-c>:update<cr>gv " gv to preserve visual selection
|
||||||
|
|
||||||
" show uncommited git changes in current part of the code
|
" show uncommited git changes in current part of the code
|
||||||
nnoremap <C-g> :CocCommand git.chunkInfo<CR>
|
nnoremap <C-g> :CocCommand git.chunkInfo<CR>
|
||||||
|
|
||||||
|
@ -112,14 +107,15 @@ if has('nvim-0.4.0') || has('patch-8.2.0750')
|
||||||
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
|
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" Find files using Telescope command-line sugar.
|
" Find files using Telescope command-line sugar.
|
||||||
nnoremap <leader>ff <cmd>Telescope find_files<cr>
|
nnoremap <leader>ff <cmd>Telescope find_files<cr>
|
||||||
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
|
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
|
||||||
nnoremap <leader>fb <cmd>Telescope buffers<cr>
|
nnoremap <leader>fb <cmd>Telescope buffers<cr>
|
||||||
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
|
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
|
||||||
|
|
||||||
|
""""""""""""""""""""""""""""
|
||||||
" config for coc#pum#visible
|
" config for coc#pum#visible
|
||||||
|
""""""""""""""""""""""""""""
|
||||||
|
|
||||||
" Some servers have issues with backup files, see #649.
|
" Some servers have issues with backup files, see #649.
|
||||||
set nobackup
|
set nobackup
|
||||||
|
@ -175,6 +171,7 @@ else
|
||||||
inoremap <silent><expr> <c-@> coc#refresh()
|
inoremap <silent><expr> <c-@> coc#refresh()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" general configs
|
" general configs
|
||||||
set modeline
|
set modeline
|
||||||
let g:sls_use_jinja_syntax = 1
|
let g:sls_use_jinja_syntax = 1
|
||||||
|
|
Loading…
Reference in a new issue