organized settings and added a note to convert it to lua
This commit is contained in:
parent
e852fd492a
commit
4ae0d9e379
1 changed files with 75 additions and 114 deletions
|
@ -1,119 +1,80 @@
|
||||||
vim.g.mapleader = " "
|
-- TODO: translate this to lua
|
||||||
|
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
set suffixes+=.aux,.bbl,.blg,.brf,.cb,.dvi,.idx,.ilg,.ind,.inx,.jpg,.log,.out,.png,.toc
|
""" Settings
|
||||||
set suffixes-=.h
|
set suffixes+=.aux,.bbl,.blg,.brf,.cb,.dvi,.idx,.ilg,.ind,.inx,.jpg,.log,.out,.png,.toc
|
||||||
set suffixes-=.obj
|
set suffixes-=.h
|
||||||
|
set suffixes-=.obj
|
||||||
|
set tabstop=3 softtabstop=3
|
||||||
|
set shiftwidth=3
|
||||||
|
set expandtab
|
||||||
|
set smartindent
|
||||||
|
" set foldmethod=indent
|
||||||
|
" set foldlevel=0
|
||||||
|
set undodir=~/.vim/undo
|
||||||
|
set undofile
|
||||||
|
set noswapfile
|
||||||
|
set hlsearch
|
||||||
|
set hidden
|
||||||
|
set ignorecase
|
||||||
|
set smartcase
|
||||||
|
set wrap
|
||||||
|
set linebreak
|
||||||
|
" set guicursor= " always use the block cursor
|
||||||
|
syntax on
|
||||||
|
set redrawtime=1000 " max syntax highlight time
|
||||||
|
set number relativenumber
|
||||||
|
set noerrorbells
|
||||||
|
set encoding=UTF-8
|
||||||
|
set cursorline
|
||||||
|
set mouse=a
|
||||||
|
set incsearch
|
||||||
|
set scrolloff=5
|
||||||
|
" set wildmenu
|
||||||
|
" set wildmode=full
|
||||||
|
" TextEdit might fail if hidden is not set.
|
||||||
|
set hidden
|
||||||
|
set cmdheight=1 " Give more space for displaying messages.
|
||||||
|
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
|
||||||
|
" delays and poor user experience.
|
||||||
|
set updatetime=300
|
||||||
|
" Don't pass messages to |ins-completion-menu|.
|
||||||
|
set shortmess+=c
|
||||||
|
" Spell check!
|
||||||
|
set spelllang=en_us
|
||||||
|
" spell check in git commits
|
||||||
|
autocmd Filetype gitcommit setlocal spell
|
||||||
|
set showcmd
|
||||||
|
set signcolumn=yes
|
||||||
|
" disable spell check in help files
|
||||||
|
autocmd FileType help setlocal nospell
|
||||||
|
filetype plugin on
|
||||||
|
" Macro for opening a new terminal with spell check off
|
||||||
|
command! Term tabnew | setlocal nospell | term
|
||||||
|
autocmd FileType help setlocal nospell
|
||||||
|
" test whitespace ->
|
||||||
|
" more test whitespace ->
|
||||||
|
" Indented text
|
||||||
|
" even more test whitespace ->
|
||||||
|
|
||||||
set tabstop=3 softtabstop=3
|
""" Key bindings
|
||||||
set shiftwidth=3
|
let mapleader = " "
|
||||||
set expandtab
|
" *sigh*...
|
||||||
set smartindent
|
command! Q q
|
||||||
" set foldmethod=indent
|
command! W w
|
||||||
" set foldlevel=0
|
command! Wq wq
|
||||||
|
command! WQ wq
|
||||||
set undodir=~/.vim/undo
|
" nnoremap ; :
|
||||||
set undofile
|
" vnoremap ; :
|
||||||
set noswapfile
|
" Press Alt h to toggle highlighting on/off, and show current value.
|
||||||
|
noremap <M-h> <cmd>set hlsearch! hlsearch?<CR>
|
||||||
set guifont=SauceCodePro\ NF\ Regular
|
noremap <M-S> <cmd>set spell! spell?<CR>
|
||||||
|
" Escape to enter normal mode in the terminal
|
||||||
set hlsearch
|
tnoremap <Esc> <C-\><C-n>
|
||||||
set hidden
|
" Replace with alt S
|
||||||
set ignorecase
|
nnoremap <M-s> :%s//g<Left><Left>
|
||||||
set smartcase
|
" Move lines around in visual mode with J and K
|
||||||
set wrap
|
vnoremap J <cmd>m '>+1<CR>gv=gv'
|
||||||
set linebreak
|
vnoremap K <cmd>m '>+1<CR>gv=gv'
|
||||||
" set guicursor= " always use the block cursor
|
|
||||||
syntax on
|
|
||||||
set redrawtime=1000 " max syntax highlight time
|
|
||||||
set number relativenumber
|
|
||||||
set noerrorbells
|
|
||||||
set encoding=UTF-8
|
|
||||||
set cursorline
|
|
||||||
set mouse=a
|
|
||||||
set incsearch
|
|
||||||
set scrolloff=5
|
|
||||||
" set wildmenu
|
|
||||||
" set wildmode=full
|
|
||||||
" TextEdit might fail if hidden is not set.
|
|
||||||
set hidden
|
|
||||||
set cmdheight=1 " Give more space for displaying messages.
|
|
||||||
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
|
|
||||||
" delays and poor user experience.
|
|
||||||
set updatetime=300
|
|
||||||
" Don't pass messages to |ins-completion-menu|.
|
|
||||||
set shortmess+=c
|
|
||||||
" Spell check!
|
|
||||||
set spelllang=en_us
|
|
||||||
" spell check in git commits
|
|
||||||
autocmd Filetype gitcommit setlocal spell
|
|
||||||
set showcmd
|
|
||||||
set signcolumn=yes
|
|
||||||
" disable spell check in help files
|
|
||||||
autocmd FileType help setlocal nospell
|
|
||||||
filetype plugin on
|
|
||||||
" Macro for opening a new terminal with spell check off
|
|
||||||
command! Term tabnew | setlocal nospell | term
|
|
||||||
autocmd FileType help setlocal nospell
|
|
||||||
" test whitespace ->
|
|
||||||
" more test whitespace ->
|
|
||||||
" Indented text
|
|
||||||
" even more test whitespace ->
|
|
||||||
|
|
||||||
" Key bindings
|
|
||||||
" let mapleader = " "
|
|
||||||
" *sigh*...
|
|
||||||
command! Q q
|
|
||||||
command! W w
|
|
||||||
command! Wq wq
|
|
||||||
command! WQ wq
|
|
||||||
" nnoremap ; :
|
|
||||||
" vnoremap ; :
|
|
||||||
" Press Alt h to toggle highlighting on/off, and show current value.
|
|
||||||
noremap <M-h> <cmd>set hlsearch! hlsearch?<CR>
|
|
||||||
noremap <M-S> <cmd>set spell! spell?<CR>
|
|
||||||
" Escape to enter normal mode in the terminal
|
|
||||||
tnoremap <Esc> <C-\><C-n>
|
|
||||||
" Replace with alt S
|
|
||||||
nnoremap <M-s> :%s//g<Left><Left>
|
|
||||||
" Wrapped line movement (hold ctrl to move like a word processor)
|
|
||||||
nmap <C-h> h
|
|
||||||
nmap <C-j> gj
|
|
||||||
nmap <C-k> gk
|
|
||||||
nmap <C-l> l
|
|
||||||
" nmap <C-4> g$
|
|
||||||
nmap <C>$ g$
|
|
||||||
nmap <C-6> g^
|
|
||||||
nmap <C-^> g^
|
|
||||||
nmap <C-0> g^
|
|
||||||
vmap <C-h> h
|
|
||||||
vmap <C-j> gj
|
|
||||||
vmap <C-k> gk
|
|
||||||
vmap <C-l> l
|
|
||||||
vmap <C-4> g$
|
|
||||||
vmap <C>$ g$
|
|
||||||
vmap <C-6> g^
|
|
||||||
vmap <C-^> g^
|
|
||||||
vmap <C-0> g^
|
|
||||||
" " Hold ctrl to move between windows, shift to reorder the windows
|
|
||||||
" nmap <C-h> <C-w>h
|
|
||||||
" nmap <C-j> <C-w>j
|
|
||||||
" nmap <C-k> <C-w>k
|
|
||||||
" nmap <C-l> <C-w>l
|
|
||||||
" nmap <C-H> <C-w>H
|
|
||||||
" nmap <C-J> <C-w>J
|
|
||||||
" nmap <C-K> <C-w>K
|
|
||||||
" nmap <C-L> <C-w>L
|
|
||||||
" " and for visual mode
|
|
||||||
" vmap <C-h> <C-w>h
|
|
||||||
" vmap <C-j> <C-w>j
|
|
||||||
" vmap <C-k> <C-w>k
|
|
||||||
" vmap <C-l> <C-w>l
|
|
||||||
" vmap <C-H> <C-w>H
|
|
||||||
" vmap <C-J> <C-w>J
|
|
||||||
" vmap <C-K> <C-w>K
|
|
||||||
" vmap <C-L> <C-w>L
|
|
||||||
|
|
||||||
colorscheme slate
|
colorscheme slate
|
||||||
]]
|
]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue