From c7853855102bc88cb19bcb8cbad02887de0635b1 Mon Sep 17 00:00:00 2001 From: mitsuo Date: Mon, 30 Mar 2020 04:55:36 -0500 Subject: names, XGD and install script --- vimrc | 91 ++++++++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 26 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 569cd36..3024e0d 100644 --- a/vimrc +++ b/vimrc @@ -7,7 +7,11 @@ " │v│i│m│r│c│←│█▓▒░ ば " └─┴─┴─┴─┴─┴─┘ れ -" Shit that gets disabled because I created this file +" XDG compliant +" TODO: sort sections + + +" Useful " ---------------------------------------------------------------------- set nocompatible " Auto-recognize files and apply pluggins @@ -15,17 +19,16 @@ set nocompatible syntax on set wildmenu set showcmd -set scrolloff=5 " show a few lines of context +set scrolloff=5 " show a few lines of context -" Options that aren't default in some systems -" ---------------------------------------------------------------------- +" not default in some systems set backspace=indent,eol,start -" Number gutter -" ---------------------------------------------------------------------- +" number gutter set nonumber set norelativenumber + " Search " ---------------------------------------------------------------------- set hlsearch @@ -35,35 +38,38 @@ nnoremap :nohl set ignorecase set smartcase + " Indentation " ---------------------------------------------------------------------- -" softtabs de 4 columnas -" TODO mapping to switch from softtabs to actual tabs by reseting expandtab and -" softtabstop +" 4 column softtabs (uses ' ', not '\t'). +" TODO: move this 'guide' to somewhere apropiate +" tab->softtab (:set tabstop=n) (:set expandtab) :retab +" softtab->tab :set noexpandtab :set tabstop={softtabstop} :retab! +" Caution: This will insert a tab wherever it can, even between words +" separated by as few as 2 spaces! set tabstop=8 set softtabstop=4 set shiftwidth=4 set expandtab " autoindent -> smartindent -> cindent -> indentexpr (from less to more " general, each one overrides the previous ones) -set smartindent " This is a really nice and simple one -"set cindent -"set cinoptions=:0,g0 " See C-indenting +set smartindent " This is a really nice and simple one +"set cindent +"set cinoptions=:0,g0 " See C-indenting + " Automatic formatting " ---------------------------------------------------------------------- " see fo-table set formatoptions=rql -set formatoptions-=o " Automatically insert the current comment leader - " after hitting 'o'. -set formatoptions+=t " auto-wrap text (when inserting) -set formatoptions+=c " auto-wrap comments (when inserting) -"set formatoptions+=a " auto-formatting of paragraphs (always). (this - " messes with being able to '=====' underline - " just below a section header comment. -set formatoptions+=p " Don't break lines after '.' -set formatoptions+=n " Allow lists -set formatoptions+=j " Removes comment leader when joining lines +set formatoptions-=o " Automatically insert the current comment leader + " after hitting 'o'. +set formatoptions+=t " auto-wrap text (when inserting) +set formatoptions+=c " auto-wrap comments (when inserting) +set formatoptions+=p " Don't break honorifics like Prof. Smith +set formatoptions+=n " Allow lists +set formatoptions+=j " Removes comment leader when joining lines + " Word wrap " ---------------------------------------------------------------------- @@ -73,6 +79,7 @@ set linebreak " "gp{motion}", where {motion} can be "[/", "]/", "ip", "i{", "a{". set textwidth=80 + " Other settings " ---------------------------------------------------------------------- set mouse=a @@ -82,6 +89,7 @@ set laststatus=2 set ruler set encoding=utf-8 + " Mappings " ---------------------------------------------------------------------- map :tabp @@ -89,12 +97,14 @@ map :tabn " TODO: Funcking unmap the F1 key "unmap + " Yanking and pasting " ---------------------------------------------------------------------- " TODO: map something to "+y (cut buffer) and "*y (selection buffer) while in " visual mode. -"vmap <++> "+y " The yank to the cut buffer (clipboard) -"vmap <++> "*y " The yank to the selection buffer +"vmap <++> "+y " The yank to the cut buffer (clipboard) +"vmap <++> "*y " The yank to the selection buffer + " Buffers " ---------------------------------------------------------------------- @@ -102,6 +112,7 @@ set hidden map :bNext map :bnext + " Printing " ---------------------------------------------------------------------- set printoptions=paper:A4,duplex:long @@ -109,12 +120,25 @@ set printoptions=paper:A4,duplex:long " TODO: Figure out how to print multibyte encodings. Enabling this settings " produces errors. " set printencoding=utf-8 -" set printmbcharset=JIS_X_1990 " This allows Japanese characters to be printed +" set printmbcharset=JIS_X_1990 " This allows Japanese characters to be printed " set printmbfont=r:Noto-Sans-CJK-JP + +" Variables +" ---------------------------------------------------------------------- +set undodir=$XDG_DATA_HOME/vim/undo +set directory=$XDG_DATA_HOME/vim/swap +set backupdir=$XDG_DATA_HOME/vim/backup +set viminfo+='1000,n$XDG_DATA_HOME/vim/viminfo +set runtimepath=$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after +" TODO fix this +"let vcpath="~/.vim/vimfun/" " vim configuration path + + " Functions " ---------------------------------------------------------------------- -source vimfun +source ~/.config/vim/fun.vim + " Additions " ---------------------------------------------------------------------- @@ -129,7 +153,22 @@ source vimfun " Replaces previous WORD arithmetic expression with result inoremap diWi=" + " iVim " ---------------------------------------------------------------------- " TODO: map :h _argument_ to :h _argument_ L_ This makes help window " to almost fill the super small screen. + + +" Plugins +" ---------------------------------------------------------------------- +" Install vim-plug +if empty(glob('~/.vim/autoload/plug.vim')) + silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +endif +call plug#begin() +Plug 'ARM9/arm-syntax-vim' +au BufNewFile,BufRead *.s,*.S set filetype=arm " arm = armv6/7 +call plug#end() -- cgit v1.2.3