aboutsummaryrefslogtreecommitdiff
path: root/.vimrc
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-05 17:33:50 +0100
committerCharles <sircharlesaze@gmail.com>2020-03-05 17:33:50 +0100
commit7f1ddd1d21e8d444f742cc5819fa0a959f5534d2 (patch)
tree618a86238cc0fecc4497556c0291a1cb469cfaf9 /.vimrc
parent7d450ffb8caf12fa6bed250b6a67d3ecb237f904 (diff)
downloaddotfiles-7f1ddd1d21e8d444f742cc5819fa0a959f5534d2.tar.gz
dotfiles-7f1ddd1d21e8d444f742cc5819fa0a959f5534d2.tar.bz2
dotfiles-7f1ddd1d21e8d444f742cc5819fa0a959f5534d2.zip
Removing tmux, profile Refactoring zsh and vim config
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc140
1 files changed, 58 insertions, 82 deletions
diff --git a/.vimrc b/.vimrc
index 318546a..6b8dd5b 100644
--- a/.vimrc
+++ b/.vimrc
@@ -1,122 +1,98 @@
-so $HOME/dotfiles/.pluggins.vim " source pluggins
+""""""""""
+" vimrc "
+""""""""""
+
+" source pluggins
+source $HOME/dotfiles/.pluggins.vim
+
+
+" common
+let mapleader = ' ' " set leader key to space
+syntax enable " enable syntax
+set hidden " keep change in buffer when quitting window
+set noswapfile " disable swap files
+set nocompatible " not compatible with vi
+filetype plugin indent on " allow to add specific rules for certain type of file
+set number relativenumber " line number relative to cursor
+set cursorline " highlight current line
+set noshowmatch " dont jump to pair bracket
+set autoread " reload files when changes happen outside vim
+set scrolloff=2 " line padding when scrolling
+set encoding=utf-8 " utf-8 encoding
+set textwidth=89 " when line wrap occurs
-let mapleader = ' '
-
-syntax enable
-set hidden
-set noswapfile
-set nocompatible
-filetype plugin indent on " add specific rules for certain file type
-set number relativenumber
" browse list with tab
set wildmode=longest,list,full
-set wildmenu
-set path+=** " for recursive :find
-" more intuitif split opening
+set wildmenu " tab to cycle through completion options
+set path+=** " recursive :find
+
+" intuitif split opening
set splitbelow
set splitright
-set fcs+=vert:\ " split separator
-" easier split navigation
+set fcs+=vert:\ " no split separator
+
+" split navigation
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
+
" spit resizing
nnoremap zh <C-W>>
nnoremap zl <C-W><
nnoremap zj <C-W>-
nnoremap zk <C-W>+
-" tab to space
-set expandtab
-set tabstop=4
+
+" tab
+set expandtab " tab to space
+set tabstop=4 " tab size
set shiftwidth=4
set smarttab
set autoindent
set smartindent
-" search
-set ignorecase
+
+" file search
+set ignorecase " case insensitive
set smartcase
-set hlsearch
+set hlsearch " match highlight
set incsearch
-" other
-set ruler
-set laststatus=2 " always a statusline
-set scrolloff=2 " 2 line above scroll
-set showcmd
-set cursorline " highlight current line
-set noshowmode " unnecessary with status bar"
-set noshowmatch
-
-set autoread " reload files when changes happen outside vim
-
-" where to place the .swp files
-" set backupdir=~/.vim-tmp,~/.tmp,~/tmp,~/var/tmp
-" set directory=~/.vim-tmp,~/.tmp,~/tmp,~/var/tmp
-" directory to ignore when searching in file tree (works with ctrlp)
+
+" status
+set laststatus=2 " always a statusline (all window)
+set showcmd " show current partial command in the bottom right
+set noshowmode " dont show current mode (i.e --INSERT--)
+
+
+" ctrlp pluggin
+" directory to ignore when searching in file tree
set wildignore=*/tmp/*,*.o,*.so,*.swp,*.zip,*/node_modules/*,*/vendor/*,.bundle/*,bin/*,.git/*
" ctrlp ignore all stuff in the .gitignore
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
-" ALE
-" highlight clear ALEErrorSign
-" highlight clear ALEWarningSign
-" let g:ale_sign_error = '>'
-" let g:ale_sign_warning = '-'
-" let g:ale_lint_on_text_changed = 'never'
-" let g:ale_lint_on_enter = 0
-" let g:ale_echo_msg_error_str = 'E'
-" let g:ale_echo_msg_warning_str = 'W'
-" let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
-" let g:ale_linters = {
-" \ 'python': ['flake8']
-" \ }
-" let g:ale_fixers = {
-" \ 'python': ['autopep8']
-" \ }
-
-" let g:gruvbox_italic=1
-" let g:gruvbox_contrast_dark="hard"
+" colorscheme
let g:onedark_terminal_italics=1
colorscheme onedark
-" set background=dark
let g:lightline = {}
-let g:lightline.colorscheme = 'one'
-
-let base16colorspace=256
-
-" NERDTree shortcut
-" map <Leader>d :NERDTreeToggle<CR>
-" map <Leader>f :NERDTreeFocus<CR>
-
-" Global copy and paste
-vnoremap <C-l> "+y
-noremap <C-m> "+P
+let g:lightline.colorscheme = 'one' " lightline theme to onedark
+" mappings
" 'Y' yank to the end of the line
noremap Y y$
-" remove trailing white space on save
-autocmd BufWritePre * %s/\s\+$//e
-
" solves annoying delay went exiting insert mode
imap <ESC> <C-C>
+" jj or kk to exit insert mode
imap jj <ESC>
imap kk <ESC>
-
" remove visual mode keybinding
map Q <ESC>
-
-" c source and header files comment formats for vim-commentary
-" autocmd Filetype c setlocal commentstring=// %s
-" autocmd Filetype h setlocal commentstring=// %s
-
-autocmd Filetype c setlocal noexpandtab
-
-set encoding=utf-8
-
-set textwidth=89 " when line wrap occurs
-
-" incsearch mapping
+" incsearch
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
+
+" remove trailing white space on save
+autocmd BufWritePre * %s/\s\+$//e
+
+" real tab in c file for school projects
+autocmd Filetype c setlocal noexpandtab