diff --git a/.gitmodules b/.gitmodules index 6acdc83..34d062a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,9 +10,6 @@ [submodule "pkgbuilds/portfolio-performance-bin"] path = pkgbuilds/portfolio-performance-bin url = https://aur.archlinux.org/portfolio-performance-bin.git -[submodule "pkgbuilds/vim-plug"] - path = pkgbuilds/vim-plug - url = https://aur.archlinux.org/vim-plug.git [submodule "pkgbuilds/terraform-ls-bin"] path = pkgbuilds/terraform-ls-bin url = https://aur.archlinux.org/terraform-ls-bin.git diff --git a/dotfiles.yml b/dotfiles.yml index 7fe7f38..5e028df 100644 --- a/dotfiles.yml +++ b/dotfiles.yml @@ -1,5 +1,4 @@ empty_directories: - - name: .config/nvim - name: .config/rofi - name: .config/gtk-3.0 - name: .config/gtk-3.0-overrides @@ -47,8 +46,6 @@ dotfiles: dir: true - from: tmux/tmux.conf to: .config/tmux/tmux.conf - - from: vim/vimrc - to: .config/nvim/init.vim - from: x/Xresources to: .config/Xresources - from: x/xinitrc @@ -105,6 +102,7 @@ dotfiles: dotfiles_remove: - .gitconfig - .vimrc + - .config/nvim/init.vim - .tmux.conf - .i3 - .gtkrc-2.0 diff --git a/pkgbuilds/vim-plug b/pkgbuilds/vim-plug deleted file mode 160000 index 6f641d4..0000000 --- a/pkgbuilds/vim-plug +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6f641d45c8d3e5aa9121430dcf09a5014ca28c2c diff --git a/playbook.yml b/playbook.yml index 99fab57..a52b3e1 100644 --- a/playbook.yml +++ b/playbook.yml @@ -248,7 +248,6 @@ curl -sSf --proto '=https' https://download.spotify.com/debian/pubkey_C85668DF69375001.gpg | gpg --import - - name: nodejs-intelephense - - name: vim-plug - name: terraform-ls-bin - name: grm-git - name: screencfg-git diff --git a/user.yml b/user.yml index e86097e..38384b6 100644 --- a/user.yml +++ b/user.yml @@ -270,20 +270,6 @@ owner: "{{ user.name }}" group: "{{ user.name }}" -- name: Vim - tags: - - user:vim - block: - - name: Install vim plugins - ansible.builtin.command: nvim --headless +PlugInstall +qall - register: vim_plugin_install - changed_when: vim_plugin_install.stderr != "" - - - name: Update vim plugins - ansible.builtin.command: nvim --headless +PlugUpdate +qall - register: vim_plugin_update - changed_when: vim_plugin_update.stderr != "" - - name: Firefox tags: - user:firefox diff --git a/vim/vimrc b/vim/vimrc deleted file mode 100644 index 749d59c..0000000 --- a/vim/vimrc +++ /dev/null @@ -1,318 +0,0 @@ -set nocompatible -filetype off -call plug#begin('~/.local/share/nvim/plugged') - -" === plugins === - -function! Cond(Cond, ...) - let opts = get(a:000, 0, {}) - return a:Cond ? opts : extend(opts, { 'on': [], 'for': [] }) -endfunction - -" editing plugins -Plug 'godlygeek/tabular', Cond(!exists('g:vscode')) -Plug 'nathanaelkane/vim-indent-guides', Cond(!exists('g:vscode')) -Plug 'tpope/vim-commentary', Cond(!exists('g:vscode')) -Plug 'airblade/vim-gitgutter', Cond(!exists('g:vscode')) - -" ui -Plug 'sickill/vim-monokai', Cond(!exists('g:vscode')) -Plug 'itchyny/lightline.vim', Cond(!exists('g:vscode')) - -" lang integrations -Plug 'lepture/vim-jinja', Cond(!exists('g:vscode')) -Plug 'fatih/vim-go', Cond(!exists('g:vscode')) -Plug 'hashivim/vim-terraform', Cond(!exists('g:vscode')) -Plug 'editorconfig/editorconfig-vim', Cond(!exists('g:vscode')) -Plug 'rust-lang/rust.vim', Cond(!exists('g:vscode')) -Plug 'rodjek/vim-puppet', Cond(!exists('g:vscode')) - -" helpers -"" distraction free writing -Plug 'junegunn/limelight.vim', Cond(!exists('g:vscode')) -Plug 'junegunn/goyo.vim', Cond(!exists('g:vscode')) -Plug 'reedes/vim-pencil', Cond(!exists('g:vscode')) - -"" markdown -Plug 'suan/vim-instant-markdown', Cond(!exists('g:vscode')) - -Plug 'dense-analysis/ale', Cond(!exists('g:vscode')) - -Plug 'neoclide/coc.nvim', Cond(!exists('g:vscode'), {'branch': 'release'}) - - -call plug#end() -filetype plugin indent on - -" == formatting == -set tabstop=4 -set smarttab -set softtabstop=4 -set shiftround -set shiftwidth=4 -set autoindent -set expandtab -set smartindent -set formatoptions=tcqjron -"set formatoptions= - -" == ui == -set cursorline -set showcmd -set number -set wildmode=list:longest -set lazyredraw -set wildmenu -set noshowmatch -set colorcolumn=80 -set laststatus=2 -set matchtime=5 -set mouse=a -set mousehide -set noerrorbells -set noshowmode -set numberwidth=2 -set relativenumber -set shortmess=rtiF -set ruler -set scrolloff=7 -set title -set titlestring="" -set ttyfast - -" == searching == -set hlsearch -set incsearch -set gdefault -set ignorecase -set magic -set smartcase - -" == folding == -set foldenable -set foldmethod=indent -set foldnestmax=2 -set foldlevelstart=2 - -" == backups == -set nobackup -set backupcopy=no -set nowritebackup - -" == swap == -set swapfile -set updatecount=200 -set updatetime=300 - -" == undo == -set undolevels=1000 -set undoreload=10000 -set undodir=~/.vim/undo -set undofile - -" == environment / directories == -set autochdir -set directory=/var/tmp,/tmp -set viewdir=~/.vim/view - -" == misc == -set autoread -set confirm -set encoding=utf-8 -set history=1000 -set modeline -set modelines=5 -set notildeop -set wildignore=*.swp,*.bak,*.pyc,*~,*.o -set hidden - -" == editing == -set backspace=indent,eol,start -" set esckeys -set matchpairs=(:),{:},[:],<:> -set notimeout -set ttimeout -set timeoutlen=1000 -set ttimeoutlen=0 -set virtualedit=block -set whichwrap=b,s - -" == line breaking == -set linebreak -set wrap -set wrapscan - -" == to use guicolors in terminal == -set termguicolors - -" === keybinds === -set signcolumn=yes - -let maplocalleader = "รถ" -let mapleader = "\" -" map w: w! - -" nnoremap w :w -nmap za -map , : - -vnoremap y y`] -vnoremap p p`] -nnoremap p p`] - -nnoremap , :nohlsearch - -noremap gV `[v`] - -map Y y$ -map j gj -map k gk - - -map N Nzz -map n nzz - -inoremap jj - -" no more ex mode -nnoremap Q - -" Use // in visual mode to search for selection -" https://vim.fandom.com/wiki/Search_for_visually_selected_text -vnoremap // y/\V=escape(@",'/\') - -if exists('g:vscode') - xmap gc VSCodeCommentary - nmap gc VSCodeCommentary - omap gc VSCodeCommentary - nmap gcc VSCodeCommentaryLine -else - nnoremap h - nnoremap j - nnoremap k - nnoremap l - - nmap :bnext - nmap :bprev - - nnoremap m :InstantMarkdownPreview - - nnoremap u :GundoToggle - nnoremap d :diffupdate - - nmap :Goyo:TogglePencil - nmap w :Goyo:TogglePencil:set colorcolumn= - - nmap c :%w !xclip -selection clipboard - nmap x :r !xclip -out -selection -clipboard - - nmap f :Autoformat - - nnoremap v vl - - syntax enable - silent! colorscheme monokai - - highlight Comment guifg=#64d86b - highlight SpecialComment guifg=#64d86b - highlight Todo guibg=#a9ebad - - let g:lightline = { - \ 'colorscheme': 'wombat', - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], - \ [ 'readonly', 'filename', 'modified', 'helloworld' ] ], - \ 'right': [ [ 'gitbranch' ], - \ [ 'lineinfo' ], - \ [ 'percent' ], - \ [ 'fileformat', 'fileencoding', 'filetype', 'charvaluehex' ], - \ [ 'directory' ] ], - \ }, - \ 'component_function': { - \ 'gitbranch': 'fugitive#head', - \ 'directory': 'LightLineFilename', - \ }, - \ 'component': { - \ }, - \ } - - - function! LightLineFilename() - return fnamemodify(expand('%F'), ":~:h") - endfunction - - " == pencil == - let g:pencil#textwidth = 80 - let g:pencil#autoformat = 1 - let g:pencil#wrapModeDefault = 'hard' - let g:pencil#map#suspend_af = 'K' - - " == goyo == - let g:goyo_width = 100 - let g:goyo_height = "90%" - let g:goyo_linenr = 0 - - autocmd! User GoyoEnter Limelight - autocmd! User GoyoLeave Limelight! - - " == limelight == - let g:limelight_default_coefficient = 0.5 - - let g:ale_linters = {'rust': ['rust-analyzer']} - - " === functions === - function! DeleteTrailingWS() - exe "normal mz" - %s/\s\+$//e - exe "normal `z" - endfunction - autocmd BufWritePre * :call DeleteTrailingWS() - - autocmd FileType yaml set shiftwidth=2 - autocmd FileType toml set shiftwidth=2 - autocmd FileType html setl shiftwidth=2 - - let g:instant_markdown_autostart = 0 - - let g:terraform_align = 1 - let g:terraform_fmt_on_save=1 - - let g:rustfmt_autosave = 1 - - inoremap - \ coc#pum#visible() ? coc#pum#next(1) : - \ CheckBackspace() ? "\" : - \ coc#refresh() - inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" - - " Make to accept selected completion item or notify coc.nvim to format - " u breaks current undo, please make your own choice. - inoremap coc#pum#visible() ? coc#pum#confirm() - \: "\u\\=coc#on_enter()\" - - function! CheckBackspace() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' - endfunction - - " Use to trigger completion. - if has('nvim') - inoremap coc#refresh() - else - inoremap coc#refresh() - endif - - if has('nvim') - inoremap coc#refresh() - else - inoremap coc#refresh() - endif - - " https://stackoverflow.com/a/8585343 - map q :bpspbnbd - - nmap gd (coc-definition) - nmap gy (coc-type-definition) - nmap gi (coc-implementation) - nmap gr (coc-references) -endif