first commit
authorGeorgios Atheridis <atheridis@tutamail.com>
Sun, 22 May 2022 16:55:12 +0000 (16:55 +0000)
committerGeorgios Atheridis <atheridis@tutamail.com>
Sun, 22 May 2022 16:55:12 +0000 (16:55 +0000)
14 files changed:
coc-settings.json [new file with mode: 0644]
init.vim [new file with mode: 0644]
plug_settings/coc/mappings.vim [new file with mode: 0644]
plug_settings/coc/settings.vim [new file with mode: 0644]
plug_settings/floaterm/mappings.vim [new file with mode: 0644]
plug_settings/nerdtree/mappings.vim [new file with mode: 0644]
plug_settings/nerdtree/settings.vim [new file with mode: 0644]
plug_settings/scope/settings.vim [new file with mode: 0644]
plug_settings/startify/settings.vim [new file with mode: 0644]
plug_settings/theme/airline.vim [new file with mode: 0644]
plug_settings/theme/color.vim [new file with mode: 0644]
vim_settings/mappings.vim [new file with mode: 0644]
vim_settings/plugins.vim [new file with mode: 0644]
vim_settings/settings.vim [new file with mode: 0644]

diff --git a/coc-settings.json b/coc-settings.json
new file mode 100644 (file)
index 0000000..971a6c0
--- /dev/null
@@ -0,0 +1,52 @@
+{
+    "diagnostic-languageserver.formatFiletypes": {
+        "python": [
+            "black",
+            "isort",
+            "docformatter"
+        ]
+    },
+    "diagnostic-languageserver.formatters": {
+        "black": {
+            "command": "black",
+            "args": [
+                "-q",
+                "-"
+            ]
+        },
+        "isort": {
+            "command": "isort",
+            "args": [
+                "-q",
+                "-"
+            ]
+        },
+        "docformatter": {
+            "command": "docformatter",
+            "args": [
+                "-"
+            ]
+        }
+    },
+    "coc.preferences.formatOnSaveFiletypes": [
+        "c",
+        "cpp",
+        "css",
+        "markdown",
+        "javascript",
+        "graphql",
+        "html",
+        "yaml",
+        "json",
+        "python",
+        "rust",
+        "toml"
+    ],
+    "html.filetypes": [
+        "html",
+        "handlebars",
+        "htmldjango",
+        "blade",
+        "jinja"
+    ]
+}
diff --git a/init.vim b/init.vim
new file mode 100644 (file)
index 0000000..56d6dd1
--- /dev/null
+++ b/init.vim
@@ -0,0 +1,15 @@
+for f in split(glob('$HOME/.config/nvim/vim_settings/*/*.vim'), '\n')
+    exe 'source' f
+endfor
+
+for f in split(glob('$HOME/.config/nvim/vim_settings/*.vim'), '\n')
+    exe 'source' f
+endfor
+
+for f in split(glob('$HOME/.config/nvim/plug_settings/*/*.vim'), '\n')
+    exe 'source' f
+endfor
+
+for f in split(glob('$HOME/.config/nvim/plug_settings/*.vim'), '\n')
+    exe 'source' f
+endfor
diff --git a/plug_settings/coc/mappings.vim b/plug_settings/coc/mappings.vim
new file mode 100644 (file)
index 0000000..b4ed16a
--- /dev/null
@@ -0,0 +1,45 @@
+" Coc Mappings
+
+" Use `[g` and `]g` to navigate diagnostics
+" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
+nmap <silent> [g <Plug>(coc-diagnostic-prev)
+nmap <silent> ]g <Plug>(coc-diagnostic-next)
+
+" GoTo code navigation.
+nmap <silent> gd <Plug>(coc-definition)
+nmap <silent> gy <Plug>(coc-type-definition)
+nmap <silent> gi <Plug>(coc-implementation)
+nmap <silent> gr <Plug>(coc-references)
+
+" Formatting selected code
+xmap <leader>f <Plug>(coc-format-selected)
+nmap <leader>f <Plug>(coc-format-selected)
+
+augroup mygroup
+  autocmd!
+  " Setup formatexpr specified filetype(s).
+  autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
+  " Update signature help on jump placeholder.
+  autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
+augroup end
+
+" Symbol renaming
+nnoremap <leader>rm <Plug>(coc-rename)
+
+" Use tab for trigger completion with characters ahead and navigate.
+" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
+" other plugin before putting this into your config.
+inoremap <silent><expr> <TAB>
+      \ pumvisible() ? "\<C-n>" :
+      \ CheckBackspace() ? "\<TAB>" :
+      \ coc#refresh()
+inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
+
+function! CheckBackspace() abort
+  let col = col('.') - 1
+  return !col || getline('.')[col - 1]  =~# '\s'
+endfunction
+
+" Use <CR> to trigger completion
+inoremap <silent><expr> <CR> pumvisible() ? "<Right>" : "\r"
+
diff --git a/plug_settings/coc/settings.vim b/plug_settings/coc/settings.vim
new file mode 100644 (file)
index 0000000..197c585
--- /dev/null
@@ -0,0 +1,3 @@
+" Highlight the symbol and its references when holding the cursor
+autocmd CursorHold * silent call CocActionAsync('highlight')
+
diff --git a/plug_settings/floaterm/mappings.vim b/plug_settings/floaterm/mappings.vim
new file mode 100644 (file)
index 0000000..98d895e
--- /dev/null
@@ -0,0 +1,6 @@
+" Floaterm
+let g:floaterm_keymap_toggle = '<F1>'
+let g:floaterm_keymap_prev   = '<F9>'
+let g:floaterm_keymap_next   = '<F10>'
+let g:floaterm_keymap_new    = '<F11>'
+let g:floaterm_keymap_kill   = '<F12>'
diff --git a/plug_settings/nerdtree/mappings.vim b/plug_settings/nerdtree/mappings.vim
new file mode 100644 (file)
index 0000000..bf92ab9
--- /dev/null
@@ -0,0 +1,3 @@
+nnoremap <leader>n :NERDTree<CR>
+nnoremap <leader>e :NERDTreeToggle<CR>
+nnoremap <leader>f :NERDTreeFocus<CR>
diff --git a/plug_settings/nerdtree/settings.vim b/plug_settings/nerdtree/settings.vim
new file mode 100644 (file)
index 0000000..843fd0c
--- /dev/null
@@ -0,0 +1,2 @@
+let g:NERDTreeGitStatusUseNerdFonts = 1
+let g:NERDTreeHighlightCursorline = 0
diff --git a/plug_settings/scope/settings.vim b/plug_settings/scope/settings.vim
new file mode 100644 (file)
index 0000000..d80951e
--- /dev/null
@@ -0,0 +1,5 @@
+augroup qs_colors
+  autocmd!
+  autocmd ColorScheme * highlight QuickScopePrimary guifg='#ff00ff' gui=underline ctermfg=155 cterm=underline
+  autocmd ColorScheme * highlight QuickScopeSecondary guifg='#aa0000' gui=underline ctermfg=81 cterm=underline
+augroup END
diff --git a/plug_settings/startify/settings.vim b/plug_settings/startify/settings.vim
new file mode 100644 (file)
index 0000000..5cb5ae1
--- /dev/null
@@ -0,0 +1,38 @@
+let g:startify_session_dir = '~/.config/nvim/session'
+
+let g:startify_lists = [
+          \ { 'type': 'files',     'header': ['   Files']            },
+          \ { 'type': 'dir',       'header': ['   Current Directory '. getcwd()] },
+          \ { 'type': 'sessions',  'header': ['   Sessions']       },
+          \ { 'type': 'bookmarks', 'header': ['   Bookmarks']      },
+          \ ]
+
+let g:startify_bookmarks = [
+            \ { 'in': '~/.config/nvim/init.vim' },
+            \ { 'b': '~/.bashrc' }
+            \ ]
+
+" You can automatically restart a session like this
+let g:startify_session_autoload = 1
+
+let g:startify_change_to_dir = 1
+
+let g:startify_session_delete_buffers = 1
+
+let g:startify_change_to_vcs_root = 1
+
+let g:startify_fortune_use_unicode = 1
+
+let g:startify_session_persistence = 1
+
+let g:startify_enable_special = 0
+
+let g:startify_custom_header = [
+      \ '    __  __                                _    ___         ',
+      \ '    \ \/ /___  _______  ______  ____     | |  / (_)___ ___ ',
+      \ '     \  / __ \/ ___/ / / / __ `/ __ \    | | / / / __ `__ \',
+      \ '     / / /_/ / /  / /_/ / /_/ / /_/ /    | |/ / / / / / / /',
+      \ '    /_/\____/_/   \__,_/\__, /\____/     |___/_/_/ /_/ /_/ ',
+      \ '                       /____/                              ',
+      \]
+
diff --git a/plug_settings/theme/airline.vim b/plug_settings/theme/airline.vim
new file mode 100644 (file)
index 0000000..1da8346
--- /dev/null
@@ -0,0 +1,4 @@
+let g:airline_powerline_fonts = 1
+let g:airline#extensions#tabline#enabled = 1
+
+let g:airline_section_z = '%3p%% %3l:%2c'
diff --git a/plug_settings/theme/color.vim b/plug_settings/theme/color.vim
new file mode 100644 (file)
index 0000000..e09a91b
--- /dev/null
@@ -0,0 +1,3 @@
+set background=light
+colo PaperColor
+let g:airline_theme='papercolor'
diff --git a/vim_settings/mappings.vim b/vim_settings/mappings.vim
new file mode 100644 (file)
index 0000000..7df71f8
--- /dev/null
@@ -0,0 +1,64 @@
+" Autocomplete navigation
+inoremap <expr> <c-j> ("\<C-n>")
+inoremap <expr> <c-k> ("\<C-p>")
+inoremap <expr> <c-l> ("\<Esc>a")
+
+" Buffer navigation
+nnoremap J :bprevious<CR>
+nnoremap K :bnext<CR>
+
+" Window navigation
+nnoremap <C-h> <C-w>h
+nnoremap <C-j> <C-w>j
+nnoremap <C-k> <C-w>k
+nnoremap <C-l> <C-w>l
+
+" Use alt +hjkl to resize windows
+nnoremap <M-h> :vertical resize -2<CR>
+nnoremap <M-j> :resize -2<CR>
+nnoremap <M-k> :resize +2<CR>
+nnoremap <M-l> :vertical resize +2<CR>
+
+" Remap escape
+inoremap jkl <Esc>
+inoremap JKL <Esc>
+
+" Tab changes buffer
+nnoremap <TAB> :bnext<CR>
+nnoremap <S-TAB> :bprevious<CR>
+
+" Sane Y default
+nnoremap Y y$
+
+" add a semicolon
+inoremap <M-;> <Esc>A;
+nnoremap <M-;> A;<Esc>
+
+" add a comma
+inoremap <M-,> <Esc>A,
+nnoremap <M-,> A,<Esc>
+
+" add 3 `
+inoremap <M-`> ```
+
+" add brackets
+inoremap <M-9> <Esc>A()<Left>
+nnoremap <M-9> A()<Left>
+
+inoremap <M-[> <Esc>A[]<Left>
+nnoremap <M-[> A[]<Left>
+
+inoremap <C-M-[> <Esc>A{}<Left>
+nnoremap <C-M-[> A{}<Left>
+
+" Move while in insert mode
+inoremap <M-h> <Left>
+inoremap <M-j> <Down>
+inoremap <M-k> <Up>
+inoremap <M-l> <Right>
+
+inoremap <C-M-h> <C-Left>
+inoremap <C-M-j> <C-Down>
+inoremap <C-M-k> <C-Up>
+inoremap <C-M-l> <C-Right>
+
diff --git a/vim_settings/plugins.vim b/vim_settings/plugins.vim
new file mode 100644 (file)
index 0000000..02a09f6
--- /dev/null
@@ -0,0 +1,69 @@
+" Auto-install vim-plug
+if empty(glob('$HOME/.local/share/nvim/site/autoload/plug.vim'))
+    silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
+        \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
+endif
+
+" Plugin List
+call plug#begin()
+
+    " Coc
+    Plug 'neoclide/coc.nvim', {'branch': 'release'}
+
+    " nerdtree
+    Plug 'preservim/nerdtree'
+    Plug 'ryanoasis/vim-devicons'
+    Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
+    Plug 'Xuyuanp/nerdtree-git-plugin'
+    Plug 'PhilRunninger/nerdtree-visual-selection'
+
+    " Auto pairs for '(' '[' '{'
+    Plug 'jiangmiao/auto-pairs'
+
+    " Surround with '(' '[' '{'
+    Plug 'tpope/vim-surround'
+
+    " Highlight for scope f and F
+    Plug 'unblevable/quick-scope'
+
+    " Mass comment / uncomment
+    Plug 'tpope/vim-commentary'
+
+    " Floaterm
+    Plug 'voldikss/vim-floaterm'
+
+    " Startify
+    Plug 'mhinz/vim-startify'
+
+    " Themes
+    Plug 'NLKNguyen/papercolor-theme'
+    Plug 'vim-airline/vim-airline'
+    Plug 'vim-airline/vim-airline-themes'
+
+call plug#end()
+
+" Coc List
+let g:coc_global_extensions = [
+    \ 'coc-clangd',
+    \ 'coc-clang-format-style-options',
+    \ 'coc-cmake',
+    \ 'coc-css',
+    \ 'coc-cssmodules',
+    \ 'coc-diagnostic',
+    \ 'coc-docker',
+    \ 'coc-json',
+    \ 'coc-go',
+    \ 'coc-highlight',
+    \ 'coc-html',
+    \ 'coc-htmldjango',
+    \ 'coc-html-css-support',
+    \ 'coc-jedi',
+    \ 'coc-json',
+    \ 'coc-markdownlint',
+    \ '@yaegassy/coc-nginx',
+    \ 'coc-rls',
+    \ 'coc-toml',
+    \ 'coc-tsserver',
+    \ 'coc-xml',
+    \ 'coc-yaml',
+\]
diff --git a/vim_settings/settings.vim b/vim_settings/settings.vim
new file mode 100644 (file)
index 0000000..18d3a1f
--- /dev/null
@@ -0,0 +1,35 @@
+syntax enable
+
+set encoding=utf-8
+set fileencoding=utf-8
+
+set mouse=a
+
+set shiftwidth=4
+set smarttab
+set expandtab
+set smartindent
+set autoindent
+
+set colorcolumn=88
+set nowrap
+set linebreak
+augroup Markdown
+    autocmd!
+    autocmd FileType markdown set wrap
+augroup END
+set number relativenumber
+set hidden
+set nohlsearch
+
+au BufEnter * set fo-=c
+au BufEnter * set fo-=o
+
+set clipboard=unnamedplus
+
+set termguicolors
+
+set nobackup
+set nowritebackup
+set updatetime=200
+set shortmess+=c