summaryrefslogtreecommitdiff
path: root/.config/vim/.vimrc
diff options
context:
space:
mode:
Diffstat (limited to '.config/vim/.vimrc')
-rw-r--r--.config/vim/.vimrc77
1 files changed, 50 insertions, 27 deletions
diff --git a/.config/vim/.vimrc b/.config/vim/.vimrc
index a217207..2bad7b5 100644
--- a/.config/vim/.vimrc
+++ b/.config/vim/.vimrc
@@ -1,31 +1,46 @@
runtime ftplugin/man.vim
-set runtimepath^=$HOME/.config/vim/.vim
-set viminfo=
-set number
-set relativenumber
-set title
-set bg=dark
-set go=a
-set mouse=a
-set nohlsearch
-set clipboard+=unnamedplus
-set noshowmode
-set noruler
-set laststatus=0
-set noshowcmd
-set nocompatible
-set autoindent
-set cindent
-set smartindent
-set nowrap
-set ignorecase
-set smartcase
-set laststatus=2
-set incsearch
-set wildignore=*.o,*.obj,*.bak,*.exe
-" Use pathogen (plugin manager)
+" General settings
+set nocompatible " Disable compatibility with Vi
+set number " Show line numbers
+set relativenumber " Show relative line numbers
+set title " Set terminal title to the file name
+set bg=dark " Set dark background for better colors
+set laststatus=2 " Show the status line with detailed info
+set showmode " Show mode at the bottom
+set noshowcmd " Don't show partial commands at the bottom
+set ruler " Show line/column info at the bottom
+
+" Search and highlighting
+set nohlsearch " Disable search highlighting after search
+set ignorecase " Ignore case in search
+set smartcase " Make search case-sensitive if uppercase letters are used
+set incsearch " Incremental search as you type
+set wildignore=*.o,*.obj,*.bak,*.exe " Ignore certain file types in file completion
+
+" Indentation and formatting
+set autoindent " Enable automatic indentation
+set cindent " Enable C-style indentation
+set smartindent " Enable smart indentation (e.g., after braces)
+set nowrap " Disable line wrapping
+
+" Clipboard and mouse
+set clipboard+=unnamedplus " Enable clipboard integration with system clipboard
+set mouse=a " Enable mouse support for scrolling, selection, etc.
+
+" Session and history
+set viminfofile=~/.config/vim/.viminfo " Set the viminfo file location
+set viminfo='100,<50,s10,h " Clear Viminfo settings (no history saving)
+
+" File paths and runtime environment
+set runtimepath^=$HOME/.config/vim/.vim " Add custom runtime path for plugins and resources
+" Miscellaneous settings
+set go=a " Enable all automatic formatting options
+set spelllang=en
+set nospell
+
+" Use pathogen (plugin manager)
filetype off
execute pathogen#infect()
execute pathogen#helptags()
@@ -48,7 +63,8 @@ autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
" Mappings
noremap <BS> dBx
nnoremap s o<Esc>kzz
-nnoremap S O<Esc>jzz
+" nnoremap S O<Esc>jzz
+nnoremap S :%s//g<Left><Left>
nnoremap Y y$
nnoremap - ddp
nnoremap _ ddkP
@@ -64,13 +80,18 @@ vnoremap <C-J> "+y
" show existing tab with 4 spaces width
set tabstop=4
+
" when indenting with '>', use 4 spaces width
set shiftwidth=4
+
" On pressing tab, insert 4 spaces
set expandtab
+" Compile R Markdown files with F5
+autocmd Filetype rmd map <F5> :!echo<space>"require(rmarkdown);<space>render('<c-r>%')"<space>\|<space>R<space>--vanilla<enter>
+
" Automatically use black on a Python file
-autocmd BufWritePost *.py !black --line-length=79 %
+autocmd BufWritePost *.py !black --line-length=79 %
" Pymode config
let g:pymode = 1
@@ -83,3 +104,5 @@ let g:pymode_indent = 1
let g:pymode_indent_hanging_width = &shiftwidth
let g:pymode_indent_hanging_width = 4
let g:pymode_doc = 1
+
+let maplocalleader = ","