add ruby stuff, remove folds
This commit is contained in:
parent
3394e6a4aa
commit
8032e3aa95
@ -1,13 +1,6 @@
|
||||
if has("autocmd")
|
||||
"filetype functions
|
||||
"------------------
|
||||
function FT_halftab()
|
||||
setlocal expandtab
|
||||
setlocal tabstop=2
|
||||
setlocal softtabstop=2
|
||||
setlocal shiftwidth=2
|
||||
endfunction
|
||||
|
||||
function FT_python()
|
||||
setlocal autoindent
|
||||
setlocal formatprg=yapf
|
||||
@ -17,6 +10,10 @@ if has("autocmd")
|
||||
xnoremap <leader>r <esc>:'<,'>:w !python3<CR>
|
||||
endfunction
|
||||
|
||||
function FT_ruby()
|
||||
setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab
|
||||
endfunction
|
||||
|
||||
function FT_go()
|
||||
set noexpandtab
|
||||
let g:go_auto_type_info = 1
|
||||
@ -31,6 +28,10 @@ if has("autocmd")
|
||||
setlocal spell
|
||||
endfunction
|
||||
|
||||
function FT_halftab()
|
||||
setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab
|
||||
endfunction
|
||||
|
||||
"global autocmds
|
||||
"-----------------
|
||||
augroup global
|
||||
@ -71,6 +72,7 @@ if has("autocmd")
|
||||
"--------------------------
|
||||
augroup language_group
|
||||
autocmd FileType python call FT_python()
|
||||
autocmd FileType ruby,eruby call FT_ruby()
|
||||
autocmd FileType go call FT_go()
|
||||
autocmd FileType html call FT_html()
|
||||
autocmd FileType markdown call FT_markdown()
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
"custom commands
|
||||
"---------------{{{
|
||||
"---------------
|
||||
"common typos and abbreviations
|
||||
cnoremap w!! w !sudo tee % > /dev/null
|
||||
command! W w !sudo tee % > /dev/null
|
||||
command! Trim %s/\s\+$//
|
||||
command! Q q
|
||||
command! WQ wq
|
||||
command! Q1 q!
|
||||
"}}}
|
||||
|
||||
command! Trim %s/\s\+$//
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
"toggle functions
|
||||
"----------------{{{
|
||||
"----------------
|
||||
function! ToggleColorColumn()
|
||||
if &cc == ''
|
||||
set cc=80
|
||||
@ -43,4 +43,3 @@ function! ToggleNetrw() "make netrw toggleable <https://vi.stackexchange.com/que
|
||||
silent Lexplore
|
||||
endif
|
||||
endfunction
|
||||
"}}}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
"leader key
|
||||
let mapleader=' '
|
||||
|
||||
"normal keybinds
|
||||
"-------------{{{
|
||||
"normal mode keybinds
|
||||
"---------------
|
||||
"paste and search
|
||||
nnoremap <silent><leader><space> :noh <BAR> :let @/ = ""<CR>
|
||||
nnoremap <leader>i :set invpaste<CR>
|
||||
@ -35,14 +35,13 @@ nnoremap <leader>cl :close<CR>
|
||||
nnoremap =j :%!python -m json.tool<CR>
|
||||
"}}}
|
||||
|
||||
"insert mode
|
||||
"-----------{{{
|
||||
"insert mode keybinds
|
||||
"--------------------
|
||||
"abbrevations
|
||||
inoreabbrev <expr> #!! "#!/usr/bin/env"
|
||||
"}}}
|
||||
|
||||
"plugin keybinds
|
||||
"{{{
|
||||
"---------------
|
||||
"netrw
|
||||
nnoremap <silent><leader>e :call ToggleNetrw()<CR>
|
||||
|
||||
@ -87,5 +86,3 @@ nnoremap <leader>b :Buffers<CR>
|
||||
nnoremap <leader>h :Helptags<CR>
|
||||
nnoremap <leader>m :Maps<CR>
|
||||
nnoremap <leader>rg :Rg<CR>
|
||||
|
||||
"}}}
|
||||
|
||||
@ -12,7 +12,10 @@ if empty(glob(plugDir))
|
||||
endif
|
||||
|
||||
"pre plugin settings
|
||||
"-------------------
|
||||
|
||||
"load plugins
|
||||
"------------
|
||||
call plug#begin(pluginDir)
|
||||
Plug 'junegunn/vim-plug'
|
||||
|
||||
@ -25,6 +28,8 @@ call plug#begin(pluginDir)
|
||||
Plug 'tpope/vim-rsi'
|
||||
Plug 'tpope/vim-eunuch'
|
||||
Plug 'tpope/vim-repeat'
|
||||
|
||||
" == external tools ==
|
||||
"git
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'tpope/vim-rhubarb'
|
||||
@ -37,6 +42,8 @@ call plug#begin(pluginDir)
|
||||
" == language support ==
|
||||
"go
|
||||
Plug 'fatih/vim-go'
|
||||
"ruby
|
||||
Plug 'vim-ruby/vim-ruby'
|
||||
"html
|
||||
Plug 'mattn/emmet-vim'
|
||||
"markdown
|
||||
@ -47,14 +54,14 @@ call plug#begin(pluginDir)
|
||||
"linting and lsp
|
||||
Plug 'w0rp/ale'
|
||||
|
||||
" == extra ==
|
||||
" == misc ==
|
||||
Plug 'flazz/vim-colorschemes'
|
||||
Plug 'editorconfig/editorconfig-vim'
|
||||
Plug 'tyru/open-browser.vim'
|
||||
call plug#end()
|
||||
|
||||
"post plugin settings
|
||||
"---------------{{{
|
||||
"--------------------
|
||||
"netrw
|
||||
let g:netrw_banner = 0
|
||||
let g:netrw_winsize = 24
|
||||
@ -70,6 +77,7 @@ let g:netrw_nogx = 1
|
||||
let g:ale_linters = {
|
||||
\ 'python': ['flake8', 'pylint'],
|
||||
\ 'javascript': ['eslint'],
|
||||
\ 'ruby': ['rubocop'],
|
||||
\ 'markdown': ['mdl', 'write-good']
|
||||
\}
|
||||
|
||||
@ -77,6 +85,7 @@ let g:ale_fixers = {
|
||||
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
||||
\ 'python': ['yapf', 'black'],
|
||||
\ 'javascript': ['prettier', 'eslint'],
|
||||
\ 'ruby': ['rubocop'],
|
||||
\ 'css': ['prettier'],
|
||||
\ 'scss': ['prettier'],
|
||||
\ 'html': ['prettier'],
|
||||
@ -97,5 +106,3 @@ let g:vim_markdown_frontmatter = 1
|
||||
|
||||
"vim-emmet
|
||||
let g:user_emmet_install_global = 0
|
||||
|
||||
"}}}
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
"source system defaults
|
||||
"----------------------{{{
|
||||
"----------------------
|
||||
if filereadable(expand('$VIMRUNTIME/defaults.vim'))
|
||||
unlet! g:skip_defaults_vim
|
||||
source $VIMRUNTIME/defaults.vim
|
||||
endif
|
||||
"}}}
|
||||
|
||||
"general settings
|
||||
"----------------{{{
|
||||
"----------------
|
||||
"encoding/format
|
||||
set encoding=utf-8
|
||||
set fileformats=unix,dos,mac
|
||||
@ -63,10 +62,9 @@ set ttimeoutlen=20 "for keycodes
|
||||
"window behaviour (ltr)
|
||||
set splitbelow
|
||||
set splitright
|
||||
"}}}
|
||||
|
||||
"os/gui settings
|
||||
"---------------{{{
|
||||
"---------------
|
||||
if has('win32')
|
||||
let &runtimepath.=",$HOME/.vim"
|
||||
endif
|
||||
@ -88,17 +86,15 @@ if has("gui_running")
|
||||
augroup END
|
||||
endif
|
||||
endif
|
||||
"}}}
|
||||
|
||||
"syntax/filetype/matchit
|
||||
"-----------------------{{{
|
||||
"-----------------------
|
||||
syntax on
|
||||
filetype plugin indent on
|
||||
runtime macros/matchit.vim
|
||||
"}}}
|
||||
|
||||
"file cleanup
|
||||
"------------{{{
|
||||
"------------
|
||||
"swap
|
||||
let mySwapDir = expand("$HOME/.vim/.swap")
|
||||
if !isdirectory(mySwapDir)
|
||||
@ -125,5 +121,4 @@ if has('writebackup')
|
||||
let &backupdir=myBackupDir
|
||||
set backup
|
||||
endif
|
||||
"}}}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user