Dotfiles/nvim/init.vim

135 lines
3.5 KiB
VimL

call plug#begin('~/.local/share/nvim/site/plugged')
Plug 'junegunn/goyo.vim'
Plug 'rktjmp/lush.nvim'
Plug 'tpope/vim-sensible'
Plug '~/Dotfiles/nvim/theme/cyberqueer.nvim'
Plug 'arecarn/vim-crunch'
Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'voldikss/vim-floaterm'
Plug 'rust-lang/rust.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()
colorscheme cyberqueer
let g:airline_powerline_fonts = 1
let g:airline_theme='cyberqueer'
syntax on
filetype on
set number
set cursorline
set cursorcolumn
syntax enable
filetype plugin indent on
" Set shift width to 4 spaces.
set shiftwidth=4
" Set tab width to 4 columns.
set tabstop=4
" Use space characters instead of tabs.
set expandtab
" Do not save backup files.
set nobackup
" Do not let cursor scroll below or above N number of lines when scrolling.
set scrolloff=10
" Do not wrap lines. Allow long lines to extend as far as the line goes.
set nowrap
" While searching though a file incrementally highlight matching characters as you type.
set incsearch
" Ignore capital letters during search.
set ignorecase
" Override the ignorecase option if searching for capital letters.
" This will allow you to search specifically for capital letters.
set smartcase
" Show partial command you type in the last line of the screen.
set showcmd
" Show the mode you are on the last line.
set showmode
" Show matching words during a search.
set showmatch
" Use highlighting when doing a search.
set hlsearch
" Set the commands to save in history default number is 20.
set history=1000
" Enable auto completion menu after pressing TAB.
set wildmenu
" Make wildmenu behave like similar to Bash completion.
set wildmode=list:longest
let time=system('date "+%H:%M:%S|%d.%m.%Y" | tr -d "\n"')
let hostname=system('hostname -s | tr -d "\n"')
let ipaddr=system('hostname -i | tr -d "\n"')
let g:airline_section_x = 'IP:%{ipaddr} DNS:%{hostname}'
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
:nnoremap t :FloatermNew<CR>
:nnoremap e :NERDTreeToggle<CR><C-W>l
:nnoremap q :q<CR>
:inoremap <TAB> <C-N>
:inoremap <S-TAB> <TAB>
" :inoremap <TAB> <C-N>
" :inoremap <S-TAB> <TAB>
"
" #####################################################
let g:coc_global_extensions=[ 'coc-snippets', 'coc-powershell', 'coc-sh', 'coc-omnisharp', 'coc-clangd', 'coc-json', 'coc-css', 'coc-git' ]
" Use <C-l> for trigger snippet expand.
imap <C-l> <Plug>(coc-snippets-expand)
" Use <C-j> for select text for visual placeholder of snippet.
vmap <C-j> <Plug>(coc-snippets-select)
" Use <C-j> for jump to next placeholder, it's default of coc.nvim
let g:coc_snippet_next = '<c-j>'
" Use <C-k> for jump to previous placeholder, it's default of coc.nvim
let g:coc_snippet_prev = '<c-k>'
" Use <C-j> for both expand and jump (make expand higher priority.)
imap <C-j> <Plug>(coc-snippets-expand-jump)
" Use <leader>x for convert visual selected code to snippet
xmap <leader>x <Plug>(coc-convert-snippet)
" #####################################################
" <Tab>: completion
inoremap <silent><expr> <Tab>
\ pumvisible() ? "\<C-N>" :
\ s:check_back_space() ? "\<Tab>" :
\ coc#refresh()
" <S-Tab>: completion back
inoremap <silent><expr> <S-Tab> pumvisible() ? "\<C-P>" : "\<C-H>"
" <CR>: confirm completion, or insert <CR>
inoremap <expr> <CR> pumvisible() ? "\<C-Y>" : "\<CR>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction