Skip to content

Commit

Permalink
Merge branch 'master' of github.com:berekuk/etc
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyacheslav Matyukhin committed Mar 9, 2015
2 parents ebed09e + e4fa4e4 commit 6955609
Show file tree
Hide file tree
Showing 12 changed files with 191 additions and 72 deletions.
1 change: 1 addition & 0 deletions bash/mac
Expand Up @@ -13,6 +13,7 @@ export PATH=$(perl -MList::MoreUtils=firstidx -E '@p = split /:/, $ENV{PATH}; $u
export PATH=/usr/local/sbin:$PATH
export PATH=/usr/local/share/npm/bin:$PATH
export PATH=/usr/local/heroku/bin:$PATH
export PATH=$PATH:./node_modules/.bin

# instead of default xterm-color, which is uncompatible with linux screen
# commented because of vim double-buffer drawing bug
Expand Down
2 changes: 2 additions & 0 deletions dotfiles/npmrc
@@ -0,0 +1,2 @@
init-author-name = Vyacheslav Matyukhin
init-author-email = me@berekuk.ru
1 change: 1 addition & 0 deletions dotfiles/slate
Expand Up @@ -62,6 +62,7 @@ bind m:${hyper} focus 'Microsoft Word'
bind v:${hyper} focus 'VLC'
bind x:${hyper} focus 'Xcode'
bind 1:${hyper} focus '1Password'
bind 2:${hyper} focus 'Anki'
bind y:${hyper} focus 'YNAB 4'
bind p:${hyper} focus 'Vista Previa'

Expand Down
109 changes: 105 additions & 4 deletions osx/com.googlecode.iterm2.plist
Expand Up @@ -44,6 +44,107 @@
<false/>
<key>FsTabDelay</key>
<real>0.43336588144302368</real>
<key>GlobalKeyMap</key>
<dict>
<key>0x9-0x40000</key>
<dict>
<key>Action</key>
<integer>32</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xd-0x100000</key>
<dict>
<key>Action</key>
<integer>13</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf700-0x300000</key>
<dict>
<key>Action</key>
<integer>7</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf701-0x300000</key>
<dict>
<key>Action</key>
<integer>6</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf702-0x300000</key>
<dict>
<key>Action</key>
<integer>2</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf702-0x320000</key>
<dict>
<key>Action</key>
<integer>33</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf703-0x300000</key>
<dict>
<key>Action</key>
<integer>0</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf703-0x320000</key>
<dict>
<key>Action</key>
<integer>34</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf729-0x100000</key>
<dict>
<key>Action</key>
<integer>5</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf72b-0x100000</key>
<dict>
<key>Action</key>
<integer>4</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf72c-0x100000</key>
<dict>
<key>Action</key>
<integer>9</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf72c-0x20000</key>
<dict>
<key>Action</key>
<integer>9</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf72d-0x100000</key>
<dict>
<key>Action</key>
<integer>8</integer>
<key>Text</key>
<string></string>
</dict>
<key>0xf72d-0x20000</key>
<dict>
<key>Action</key>
<integer>8</integer>
<key>Text</key>
<string></string>
</dict>
</dict>
<key>HiddenAFRStrokeThickness</key>
<real>0.0</real>
<key>HiddenAdvancedFontRendering</key>
Expand Down Expand Up @@ -119,11 +220,11 @@
<integer>1</integer>
</dict>
<key>NSWindow Frame Preferences</key>
<string>516 308 924 485 0 0 1440 878 </string>
<string>516 307 924 485 0 0 1440 877 </string>
<key>NSWindow Frame SUStatusFrame</key>
<string>528 562 384 129 0 0 1440 878 </string>
<key>NSWindow Frame iTerm Window 0</key>
<string>0 26 1440 851 0 0 1440 877 </string>
<string>0 9 1438 864 0 0 1440 877 </string>
<key>NSWindow Frame iTerm Window 1</key>
<string>183 68 570 451 0 0 1440 878 </string>
<key>New Bookmarks</key>
Expand Down Expand Up @@ -913,7 +1014,7 @@
<key>SUHasLaunchedBefore</key>
<true/>
<key>SULastCheckTime</key>
<date>2014-11-20T20:27:34Z</date>
<date>2015-01-15T22:35:33Z</date>
<key>SavePasteHistory</key>
<false/>
<key>ShowBookmarkName</key>
Expand Down Expand Up @@ -959,6 +1060,6 @@
<key>findRegex_iTerm</key>
<false/>
<key>iTerm Version</key>
<string>2.0.0.20141022</string>
<string>2.0.0.20141103</string>
</dict>
</plist>
41 changes: 41 additions & 0 deletions vim/bindings.vim
@@ -0,0 +1,41 @@
" Easier to type than default '\'.
let mapleader = ","
let maplocalleader = ","

" Disable search highlight.
map <F2> :nohlsearch<CR>
" Toggle visibility of tabs and spaces.
map <F3> :set list!<CR>
" I switched off 'use all F* keys as standard function keys' setting on my Mac
" recently, so hitting F3 is now less convenient
map <Leader><Tab> :set list!<CR>
" Switch encoding.
" I rarely use it these days.
map <F5> :e ++enc=cp1251<CR>
map <F6> :e ++enc=utf-8<CR>
map <F7> :e ++enc=koi8-r<CR>
" Disable Ex mode - I never use it.
" See also: http://stackoverflow.com/questions/1269689/to-disable-entering-ex-mode-in-vim
map Q <Nop>
" toggle 'set paste'
set pastetoggle=<F8>

" delete all trailing spaces
nnoremap <Leader><Space> :%s/\s\+$//<CR>
" insert current date
nnoremap <Leader>d "=strftime("(%d %b %Y)")<CR>Pbb~f)a<CR><CR><Esc>k
" insert current time
nnoremap <Leader>t "=strftime("(%H:%M)")<CR>Pbb~f)a<CR><CR><Esc>k
" lookup using Dash.app
nnoremap <Leader>, :Dash<CR>
" command mode
cnoremap <C-a> <Home>
cnoremap <Esc>b <S-Left>
cnoremap <Esc>f <S-Right>
2 changes: 2 additions & 0 deletions vim/gitcommit.vim
@@ -0,0 +1,2 @@
" Highlight 'git commit' contents.
autocmd BufNewFile,BufRead COMMIT_EDITMSG set filetype=gitcommit
6 changes: 6 additions & 0 deletions vim/html.vim
@@ -0,0 +1,6 @@
autocmd Filetype html,xml,xsl source ~/etc/vim/bundle/closetag.vim/plugin/closetag.vim
autocmd FileType html setlocal ts=2 sw=2 sts=2

" additional mappings for closetag.vim
inoremap <C-c> <C-R>=GetCloseTag()<CR>
map <C-c> a<C-_><ESC>
1 change: 1 addition & 0 deletions vim/js.vim
@@ -1 +1,2 @@
autocmd Filetype javascript setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd BufNewFile,BufRead .eslintrc set filetype=javascript
1 change: 1 addition & 0 deletions vim/make.vim
@@ -0,0 +1 @@
autocmd FileType make setlocal noexpandtab
3 changes: 1 addition & 2 deletions vim/perl.vim
@@ -1,6 +1,5 @@
" Run current perl test.
autocmd Filetype javascript nnoremap <LocalLeader>t :!prove -v %<CR>
autocmd Filetype perl nnoremap <LocalLeader>t :!prove -v %<CR>
" Search for perl modules in ./lib on 'gf'.
set path+=lib

20 changes: 10 additions & 10 deletions vim/bundles.vim → vim/plugins.vim
@@ -1,28 +1,28 @@
set runtimepath^=~/etc/vim

set nocompatible " nobody cares about stupid classic vi
filetype off

" set the runtime path to include Vundle and initialize
set runtimepath+=~/etc/vim/bundle/Vundle.vim
call vundle#begin('~/etc/vim/bundle')
let g:vundle_default_git_proto = 'git'

Plugin 'gmarik/Vundle.vim'

Plugin 'closetag.vim'
Plugin 'kchmck/vim-coffee-script'
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
Plugin 'othree/html5.vim'
Plugin 'perl-support.vim'
Plugin 'pangloss/vim-javascript'
Plugin 'kchmck/vim-coffee-script'
Plugin 'mxw/vim-jsx'
Plugin 'vim-perl/vim-perl'
Plugin 'hynek/vim-python-pep8-indent'

Plugin 'godlygeek/tabular' " required by vim-markdown
Plugin 'plasticboy/vim-markdown'

Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'

Plugin 'scrooloose/syntastic'
let g:syntastic_check_on_open = 1
let g:syntastic_javascript_checkers = ["eslint", "jshint"]

Plugin 'rizzatti/dash.vim'

call vundle#end()
filetype plugin indent on
76 changes: 20 additions & 56 deletions vim/vimrc
@@ -1,26 +1,27 @@
source ~/etc/vim/bundles.vim
set runtimepath^=~/etc/vim
set nocompatible " nobody cares about stupid classic vi
filetype off

source ~/etc/vim/plugins.vim

filetype plugin indent on

set ttyfast

set modelines=5

" set autoindent " keep cursor in the same column on cr
set encoding=utf8 " utf is default
set fileencodings=utf-8,cp1251 " detect cp1251 if possible

" Not sure about the difference of these options.
set tabstop=4
" Spaces instead of tabs.
set expandtab

set tabstop=8
set shiftwidth=4
set softtabstop=4

set backspace=indent,eol,start " allow backspace everywhere

" Spaces instead of tabs.
set expandtab

au FileType make setlocal noexpandtab
au FileType html setlocal ts=2 sw=2 sts=2

" Highlight trailing tabs and spaces.
set list
set listchars=tab:↣⇢,trail:·
Expand Down Expand Up @@ -48,6 +49,7 @@ set showcmd

set wrap

" set autoindent " keep cursor in the same column on cr
" Smart indentation of { and }.
" set smartindent <--- why is this commented? arrgh, my indentation settings are messed up.
" ...but disable indentation of comments.
Expand All @@ -60,60 +62,22 @@ set wildmode=list:longest " consistent with bash
set background=light
colorscheme my

" Easier to type than default '\'.
let mapleader = ","
let maplocalleader = ","

" Disable search highlight.
map <F2> :nohlsearch<CR>
" Toggle visibility of tabs and spaces.
map <F3> :set list!<CR>
" I switched off 'use all F* keys as standard function keys' setting on my Mac
" recently, so hitting F3 is now less convenient
map <LocalLeader><Tab> :set list!<CR>
" Switch encoding.
" I rarely use it these days.
map <F5> :e ++enc=cp1251<CR>
map <F6> :e ++enc=utf-8<CR>
map <F7> :e ++enc=koi8-r<CR>
" Disable Ex mode - I never use it.
" See also: http://stackoverflow.com/questions/1269689/to-disable-entering-ex-mode-in-vim
map Q <Nop>
" toggle 'set paste'
set pastetoggle=<F8>

" delete all trailing spaces
nnoremap <LocalLeader><Space> :%s/\s\+$//<CR>
" insert current date
:nnoremap <LocalLeader>d "=strftime("(%d %b %Y)")<CR>Pbb~f)a<CR><CR><Esc>k
" insert current time
:nnoremap <LocalLeader>t "=strftime("(%H:%M)")<CR>Pbb~f)a<CR><CR><Esc>k
" lookup using Dash.app
:nnoremap <LocalLeader>, :Dash<CR>
set directory=~/tmp/vim//

" Highlight 'git commit' contents.
autocmd BufNewFile,BufRead COMMIT_EDITMSG set filetype=gitcommit


autocmd Filetype html,xml,xsl source ~/etc/vim/bundle/closetag.vim/plugin/closetag.vim
" gx opens urls with '?', '&' and ':'.
set isfname+=?,&,:

syntax on

" gx opens urls with '?', '&' and ':'.
set isfname+=?,&,:
source ~/etc/vim/bindings.vim

source ~/etc/vim/gitcommit.vim
source ~/etc/vim/markdown.vim
source ~/etc/vim/make.vim
source ~/etc/vim/perl.vim
source ~/etc/vim/ruby.vim
source ~/etc/vim/markdown.vim
source ~/etc/vim/js.vim
source ~/etc/vim/html.vim

""""""""""""""""" TODO """""""""""""""
""""""""""""""""" TODO """""""""""""""""
" set hidden?

0 comments on commit 6955609

Please sign in to comment.