mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 08:39:42 -04:00
vim module
This commit is contained in:
parent
08d8bebfd4
commit
a4f852ec43
2 changed files with 65 additions and 0 deletions
|
|
@ -0,0 +1,61 @@
|
|||
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
||||
if empty(glob(data_dir . '/autoload/plug.vim'))
|
||||
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
||||
endif
|
||||
|
||||
if empty(glob('~/.vim/plugged'))
|
||||
silent! :PlugInstall | q
|
||||
endif
|
||||
|
||||
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
|
||||
\| PlugInstall --sync | source $MYVIMRC
|
||||
\| endif
|
||||
|
||||
call plug#begin('~/.vim/plugged')
|
||||
|
||||
Plug 'joshdick/onedark.vim'
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
Plug 'mtdl9/vim-log-highlighting'
|
||||
Plug 'machakann/vim-highlightedyank'
|
||||
Plug 'itchyny/lightline.vim'
|
||||
|
||||
call plug#end()
|
||||
|
||||
let mapleader = " "
|
||||
colorscheme onedark
|
||||
|
||||
let $FZF_DEFAULT_OPTS = '--bind=tab:up,shift-tab:down'
|
||||
let g:fzf_layout = { 'window': 'enew' }
|
||||
let g:highlightedyank_highlight_duration = 80
|
||||
let g:lightline = { 'colorscheme': 'one', }
|
||||
|
||||
set laststatus=2
|
||||
set number
|
||||
set relativenumber
|
||||
set noincsearch
|
||||
set clipboard=unnamedplus
|
||||
set ignorecase
|
||||
set noswapfile
|
||||
|
||||
set tabstop=2
|
||||
set shiftwidth=2
|
||||
set expandtab
|
||||
|
||||
highlight HighlightedyankRegion ctermfg=NONE guifg=NONE
|
||||
highlight Normal ctermbg=NONE guibg=NONE
|
||||
highlight NormalNC ctermbg=NONE guibg=NONE
|
||||
highlight Search ctermfg=yellow guifg=yellow
|
||||
highlight Search ctermfg=NONE guifg=NONE
|
||||
|
||||
vnoremap < <gv
|
||||
vnoremap > >gv
|
||||
|
||||
nnoremap <C-U> <C-U>zz
|
||||
nnoremap <C-D> <C-D>zz
|
||||
nnoremap <leader><ESC> :noh<CR>
|
||||
nnoremap <leader>/ :Rg<Space>
|
||||
nnoremap <Leader>ts :execute "normal! a" . strftime('[%b %d %H:%M:%S - BR]')<CR>
|
||||
|
|
@ -9,7 +9,11 @@ in
|
|||
config = mkIf cfg.enable {
|
||||
programs.vim = {
|
||||
enable = true;
|
||||
package = pkgs.vim;
|
||||
extraConfig = import ./config/vimrc;
|
||||
};
|
||||
programs.bash.shellAliases = {
|
||||
vi = "${pkgs.vim}/bin/vim";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue