From 88b9a03093a9cf56bb79c42ad855acb012094bf0 Mon Sep 17 00:00:00 2001 From: Szwendacz99 Date: Wed, 19 Oct 2022 15:11:04 +0200 Subject: [PATCH] Small cleaning, update README --- README.md | 87 ++++++++++++++++++++++++++++++++++++++++--------------- init.vim | 17 +++++------ 2 files changed, 71 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 86a3324..0f41670 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ I made this public so I can easily clone without authentication, but since I treat this as a personal use only stuff, there can be some(read "a lot of") messy stuff. - + Much of this might have been selectively copy pasted from plugin repos. Those repos are obviously listed in plugin setup part. @@ -22,7 +22,8 @@ sudo dnf install \ fd-find \ nodejs-bash-language-server \ tree-sitter-cli \ - wl-clipboard + wl-clipboard \ + unifont-fonts.noarch pip install \ pynvim \ @@ -32,13 +33,12 @@ pip install \ bandit \ yapf \ rope - + 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' ``` -##### - +##### ##### 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 ``` -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) +##### 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 ##### Opened files navigation: -
Ctrl w w +
<leader> m m +open minimap +
<leader> m c +close minimap +
<leader> m f +focus minimap +
Ctrl w w Move to next splitted frame
Ctrl w <arrow> moving throught splitted frame @@ -75,20 +94,20 @@ Hacked font is needed to display file type icons: ##### File explorer: -
Ctrl+t +
Ctrl+t Toggle file explorer when not focused on it
f Toggle filtering when focused on explorer
<leader> n Move focus to explorer -
d -Delete selected file -
rn -Rename file -
c -add file to clipboard -
p -paste (file) from clipboard +
d +Delete selected file +
rn +Rename file +
c +add file to clipboard +
p +paste (file) from clipboard
##### File searching / Telescope @@ -96,7 +115,17 @@ Hacked font is needed to display file type icons:
<leader>ffFind files
<leader>fgLive grep
<leader>fbBuffers -
<leader>fhHelp tags
+
<leader>fhHelp tags
Ctrl+qOpen search result list as a dedicated split (quickfix list) (will overwrite previous one created this way in current tab)
Ctrl+u +Scroll preview up +
Ctrl+d +Scroll preview down +
Ctrl+x +Open selection as a split +
Ctrl+v +Open selection as a vsplit +
Ctrl+t +Open selection in new tab +
##### Git stuff @@ -108,10 +137,19 @@ Genreal git commands: ```bash :Git -#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 \ # 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 commit ``` Nice single file diff viewer: @@ -131,10 +169,13 @@ coc-git provides some commands for git: :CocCommand git.showBlameDoc ``` -##### Code editing stuff +##### Code editing stuff - -
<leader>rnrename element (function name, etc):
<leader>ftformat code +
w +jump forward by one word +
b +jump backward by one word +
<leader>rnrename element (function name, etc):
<leader>ftformat code
gd go to definition
gy @@ -150,8 +191,8 @@ coc-git provides some commands for git: scroll up popup with docstring
ZZ same as :wq -
Ctrl+q -Visual block mode +
Ctrl+q +Visual block mode
##### Sessions diff --git a/init.vim b/init.vim index a0fc01f..3ea9af0 100644 --- a/init.vim +++ b/init.vim @@ -4,12 +4,13 @@ call plug#begin() Plug 'kyazdani42/nvim-web-devicons' " optional, for file icons Plug 'kyazdani42/nvim-tree.lua' -" neovim lsp plugins +" neovim lsp plugins and depencencies Plug 'neovim/nvim-lspconfig' Plug 'williamboman/mason.nvim' Plug 'williamboman/mason-lspconfig.nvim' Plug 'jose-elias-alvarez/null-ls.nvim' +" various plugins 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 'neoclide/coc.nvim', {'branch': 'release'} @@ -44,19 +45,12 @@ call plug#end() " load main lua file with additional configs lua require("general") -"autocmd BufEnter *.sls :setlocal filetype=yaml +" highlight all .conf files as apache config (:]) 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 -" : represents Control key -" : Alt key - "nerdtree bindings nnoremap n :NvimTreeFocus nnoremap :NvimTreeToggle -nnoremap :NvimTreeFindFile " nerdcommenter custom bindings nmap NERDCommenterToggle @@ -66,6 +60,7 @@ vmap NERDCommenterToggle nnoremap :update inoremap :update vnoremap :updategv " gv to preserve visual selection + " show uncommited git changes in current part of the code nnoremap :CocCommand git.chunkInfo @@ -112,14 +107,15 @@ if has('nvim-0.4.0') || has('patch-8.2.0750') vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" endif - " Find files using Telescope command-line sugar. nnoremap ff Telescope find_files nnoremap fg Telescope live_grep nnoremap fb Telescope buffers nnoremap fh Telescope help_tags +"""""""""""""""""""""""""""" " config for coc#pum#visible +"""""""""""""""""""""""""""" " Some servers have issues with backup files, see #649. set nobackup @@ -175,6 +171,7 @@ else inoremap coc#refresh() endif + " general configs set modeline let g:sls_use_jinja_syntax = 1