feat: add intellij vim config

This commit is contained in:
jabuxas 2024-10-10 18:23:38 -03:00
parent 41c44d315f
commit 8b1a2afe54

View File

@ -0,0 +1,133 @@
" plugins
Plug 'tpope/vim-commentary'
set which-key
set commentary
" Set mouse to "a"
set mouse=a
" Set line numbers and relative line numbers
set nu
set rnu
" Append to clipboard
set clipboard+=unnamedplus
" Set tab settings
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
" Enable smart indentation
set smartindent
" Disable text wrapping
set nowrap
" Disable swap and backup files, enable undofile
set noswapfile
set nobackup
let &undodir = $HOME . "/.vim/undodir"
set undofile
" Disable highlighting search results and enable incremental search
set nohlsearch
set incsearch
" Set scrolloff and signcolumn
set scrolloff=8
set signcolumn=yes
" Set filename characters
set isfname+=@-@
" Set update time
set updatetime=50
" Set colorcolumn
set colorcolumn=80
autocmd WinLeave * let &colorcolumn = "0"
autocmd WinEnter * let &colorcolumn = "80"
" Disable status line, command line, ruler, and mode display
set laststatus=0
set noshowcmd
set noruler
set noshowmode
" Set conceal level and cursor
set conceallevel=2
set concealcursor=n
" Set map leader to " "
let mapleader = " "
" Set case insensitive searching, smart case, and completion options
set ignorecase
set smartcase
set completeopt=menuone,noselect
" Set split settings
set splitright
set splitbelow
" Enable termguicolors and set terminal color
set termguicolors
let &t_Cs = "\e[4:3m"
let &t_Ce = "\e[4:0m"
set notimeout
" Normal mode mappings
nnoremap <silent> J :m '>+1<CR>gv=gv
nnoremap <silent> K :m '<-2<CR>gv=gv
nnoremap <silent> J mzJ`z
nnoremap <silent> <C-d> <C-d>zz
nnoremap <silent> <C-u> <C-u>zz
nnoremap <silent> n nzzzv
nnoremap <silent> N Nzzzv
nnoremap <leader>p [["_dP]]
nnoremap <silent> <leader>yy "+y
nnoremap <silent> <leader>Y "+Y
nnoremap <leader>dd "_d
nnoremap <silent> <C-c> <Esc>
nnoremap Q <nop>
nnoremap <silent> <A-k> :cnext<CR>zz
nnoremap <silent> <A-j> :cprev<CR>zz
nnoremap <silent> <leader>k :lnext<CR>zz
nnoremap <silent> <leader>j :lprev<CR>zz
nnoremap <leader>rr :%s/\<\<<C-r><C-w>\>/\<C-r><C-w>/gI<Left><Left><Left><Left>zz
nnoremap <silent> <leader>x :!chmod +x %<CR><CR>
nnoremap <leader>q :!go run %<CR><CR>
nnoremap <leader><Esc> <C-\><C-n>
nnoremap <leader>Sh <C-w>szz
nnoremap <leader>Sv <C-w>vzz
nnoremap <leader>Se <C-w>=zz
nnoremap <leader>Sx :close<CR>
nnoremap <C-l> <C-w>lzz
nnoremap <C-h> <C-w>hzz
nnoremap <C-j> <C-w>jzz
nnoremap <C-k> <C-w>kzz
nnoremap + <C-a>zz
nnoremap - <C-x>zz
nnoremap <left> 4<C-w><
nnoremap <right> 4<C-w>>
nnoremap <up> 4<C-w>+
nnoremap <down> 4<C-w>-
nnoremap <leader>gsj :GoTagAdd json <CR>zz
nnoremap <leader>gsy :GoTagAdd yaml <CR>zz
nnoremap <A-.> :bnext<CR>zz
nnoremap <A-,> :bprev<CR>zz
nnoremap <A-x> :bdelete<CR>zz
map <C-e> <action>(ActivateProjectToolWindow)
map <leader>sf <action>(SearchEverywhere)
map <leader>f <action>(ReformatCode)
" Visual mode mappings
vnoremap <silent> J :m '>+1<CR>gv=gv
vnoremap <silent> K :m '<-2<CR>gv=gv
vnoremap <silent> <leader>yy "+y
vnoremap <silent> <leader>dd "_d