Initial commit v2

This commit is contained in:
Szwendacz99 2022-10-05 21:22:26 +02:00
parent a71c537144
commit 0b30615433
4 changed files with 229 additions and 0 deletions

9
README.md Normal file
View file

@ -0,0 +1,9 @@
# My personal nvim configuration
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.

102
coc-settings.json Normal file
View file

@ -0,0 +1,102 @@
{
"codeLens.enable": true,
"codeLens.position": "eol",
"coc.preferences.extensionUpdateCheck": "daily",
"coc.preferences.enableMessageDialog": true,
"coc.preferences.formatOnType": true,
"coc.preferences.willSaveHandlerTimeout": 1000,
"coc.preferences.enableLinkedEditing": true,
"coc.preferences.formatOnSaveFiletypes": [
"c",
"go",
"python",
"rust",
"markdown",
"javascript",
"typescript",
"json",
"jsonc"
],
"coc.source.file.ignoreHidden": false,
"clangd.path": "~/bin/clangd",
"clangd.arguments": [
"--query-driver=/usr/bin/clang++",
"--header-insertion-decorators=false",
"--background-index"
],
"deno.importMap": "./import_map.json",
"diagnostic.floatConfig": {
"rounded": true,
"border": true
},
"diagnostic.format": "%message [%source]",
"diagnostic.virtualText": true,
"diagnostic.checkCurrentLine": true,
"diagnostic.separateRelatedInformationAsDiagnostics": true,
"eslint.autoFixOnSave": true,
"eslint.format.enable": true,
"eslint.packageManager": "yarn",
"git.addGBlameToVirtualText": true,
"hover.floatConfig": {
"rounded": true,
"border": true
},
"list.normalMappings": {
"<C-c>": "do:exit"
},
"list.insertMappings": {
"<C-c>": "do:exit"
},
"list.source.grep.useLiteral": false,
"list.source.grep.defaultArgs": [
"--ignore-case"
],
"markdownlint.config": {
"default": true,
"line-length": false
},
"python.formatting.provider": "autopep8",
"python.linting.enabled": true,
"python.analysis.diagnosticMode": "workspace",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.pycodestyle": true,
"python.linting.pylamaEnabled": true,
"python.linting.banditEnabled": true,
"python.linting.mypyEnabled": true,
"python.linting.pytypeEnabled": true,
"semanticTokens.enable": true,
"signature.target": "echo",
"suggest.detailField": "abbr",
"suggest.defaultSortMethod": "none",
"suggest.selection": "recentlyUsedByPrefix",
"suggest.noselect": false,
"suggest.floatConfig": {
"rounded": true,
"border": true
},
"signature.floatConfig": {
"rounded": true,
"border": true
},
"sumneko-lua.enableNvimLuaDev": true,
"Lua.completion.callSnippet": "Both",
"Lua.completion.postfix": ".",
"Lua.runtime.version": "LuaJIT",
"Lua.telemetry.enable": false,
"Lua.diagnostics.globals": [
"vim",
"jit"
],
"snippet.choicesMenuPicker": true,
"snippets.ultisnips.enable": false,
"snippets.extends": {
"javascriptreact": [
"javascript"
],
"typescript": [
"javascript"
]
},
"languageserver": {}
}

118
init.vim Normal file
View file

@ -0,0 +1,118 @@
call plug#begin()
" TODO
" Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'scrooloose/nerdtree'
Plug 'dracula/vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'preservim/nerdcommenter'
Plug 'mhinz/vim-startify'
Plug 'rmagatti/auto-session'
"Fuzzy search by Telescope and its dependencies:
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' }
Plug 'BurntSushi/ripgrep'
call plug#end()
" load lua file (empty for now)
lua require("general")
"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
" nerdcommenter custom bindings
nmap <C-_> <plug>NERDCommenterToggle
vmap <C-_> <plug>NERDCommenterToggle
"plugin configuration
syntax enable
colorscheme dracula
set splitright
set splitbelow
" indent/unindent with tab/shift-tab
nmap <Tab> >>
nmap <S-tab> <<
imap <S-Tab> <Esc><<i
vmap <Tab> >gv
vmap <S-Tab> <gv
" Remap <C-f> and <C-b> for scroll float windows/popups.
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
" Run the Code Lens action on the current line.
nmap <leader>cl <Plug>(coc-codelens-action)
" Find files using Telescope command-line sugar.
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" Use tab for trigger completion with characters ahead and navigate.
" NOTE: There's always complete item selected by default, you may want to enable
" no select by `"suggest.noselect": true` in your configuration file.
" 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>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice.
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
" general configs
set showmatch " show matching
set ignorecase " case insensitive
"set mouse=v " middle-click paste with
set hlsearch " highlight search
set incsearch " incremental search
set tabstop=4 " number of columns occupied by a tab
set softtabstop=4 " see multiple spaces as tabstops so <BS> does the right thing
set expandtab " converts tabs to white space
set shiftwidth=4 " width for autoindents
set autoindent " indent a new line the same amount as the line just typed
set number " add line numbers
set wildmode=longest,list " get bash-like tab completions
set cc=80 " set an 80 column border for good coding style
filetype plugin indent on "allow auto-indenting depending on file type
syntax on " syntax highlighting
"set mouse=a " enable mouse click
set clipboard=unnamedplus " using system clipboard
filetype plugin on
set cursorline " highlight current cursorline
set ttyfast " Speed up scrolling in Vim
" set spell " enable spell check (may need to download language package)
" set noswapfile " disable creating swap file
" set backupdir=~/.cache/vim " Directory to store backup files.

0
lua/general.lua Normal file
View file