Browse Source

New beginning.

blallo 7 months ago
commit
11dcf9bee3

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
1
+/black
2
+__pycache__/*

+ 13
- 0
archbootstrap.sh View File

@@ -0,0 +1,13 @@
1
+#!/usr/bin/env bash
2
+
3
+
4
+sudo pacman -Sy \
5
+    base-devel \
6
+    prettier \
7
+    yapf \
8
+    autopep8 \
9
+    python-black \
10
+    mypy \
11
+    python-greenlet
12
+
13
+pip3 install --user pynvim

+ 2526
- 0
autoload/plug.vim
File diff suppressed because it is too large
View File


+ 1
- 0
bundle/Dockerfile.vim

@@ -0,0 +1 @@
1
+Subproject commit da5d2b890d567e610d5f0f44a199d95b1f3148c5

+ 1
- 0
bundle/ale

@@ -0,0 +1 @@
1
+Subproject commit 79e42fed14b35767d53d7d443a644a037e012b89

+ 1
- 0
bundle/auto-pairs

@@ -0,0 +1 @@
1
+Subproject commit 39f06b873a8449af8ff6a3eee716d3da14d63a76

+ 1
- 0
bundle/awesome-vim-colorschemes

@@ -0,0 +1 @@
1
+Subproject commit dec452fcf71c8d09c4029fe28d9ac12af935f6ac

+ 1
- 0
bundle/black

@@ -0,0 +1 @@
1
+Subproject commit 188c31db7c831741e69b067c53dd040917ac03f7

+ 1
- 0
bundle/cosmic_latte

@@ -0,0 +1 @@
1
+Subproject commit 1e0e8ad982ec592709634c16a451e8ab286d20b7

+ 1
- 0
bundle/deoplete.nvim

@@ -0,0 +1 @@
1
+Subproject commit 9d4e88f6cce63ed1b52ca2401d809c55ab443b25

+ 1
- 0
bundle/fzf.vim

@@ -0,0 +1 @@
1
+Subproject commit ac4e7bfb36c88d27799c080218cea3bb833bdbd9

+ 1
- 0
bundle/nerdtree

@@ -0,0 +1 @@
1
+Subproject commit 67fa9b3116948466234978aa6287649f98e666bd

+ 1
- 0
bundle/nerdtree-git-plugin

@@ -0,0 +1 @@
1
+Subproject commit 325a1298b0c9d8a4c61388a2f9956a534a9068cd

+ 1
- 0
bundle/nvim-yarp

@@ -0,0 +1 @@
1
+Subproject commit 1524cf7988d1e1ed7475ead3654987f64943a1f0

+ 1
- 0
bundle/rust.vim

@@ -0,0 +1 @@
1
+Subproject commit 9984b9753606fe2c8d7f3d4f9d67c1777a967cd6

+ 1
- 0
bundle/seoul256.vim

@@ -0,0 +1 @@
1
+Subproject commit 1475b7610663c68aa90b6e565997c8792ce0d222

+ 1
- 0
bundle/srcery-vim

@@ -0,0 +1 @@
1
+Subproject commit a52ad903402cddc204e105fde94c4ceaa024b8b5

+ 1
- 0
bundle/tagbar

@@ -0,0 +1 @@
1
+Subproject commit 387bbadda98e1376ff3871aa461b1f0abd4ece70

+ 1
- 0
bundle/vim

@@ -0,0 +1 @@
1
+Subproject commit 837fd7292274e0ee2f3b5aee4519c3f74d7dc3d1

+ 1
- 0
bundle/vim-airline

@@ -0,0 +1 @@
1
+Subproject commit 9a1acf144fd63cae6f48a3b445958d737c0b167e

+ 1
- 0
bundle/vim-airline-themes

@@ -0,0 +1 @@
1
+Subproject commit e6f233231b232b6027cde6aebeeb18d9138e5324

+ 1
- 0
bundle/vim-fugitive

@@ -0,0 +1 @@
1
+Subproject commit 5d99841b22928f1597d447c68de844989bf9a804

+ 1
- 0
bundle/vim-go

@@ -0,0 +1 @@
1
+Subproject commit c4b419db6c57125e91d6f292daa664b73b155b7b

+ 1
- 0
bundle/vim-hug-neovim-rpc

@@ -0,0 +1 @@
1
+Subproject commit 55db7affbc9527464a88fb2d5f133f4994415f10

+ 1
- 0
bundle/vim-hybrid

@@ -0,0 +1 @@
1
+Subproject commit f44c626c9ea72a091ee8b90dbaab1659f8980ab1

+ 1
- 0
bundle/vim-hybrid-material

@@ -0,0 +1 @@
1
+Subproject commit f2e92ac7e5c4bb75d72f0abaea939e4364e00e2e

+ 1
- 0
bundle/vim-multiple-cursors

@@ -0,0 +1 @@
1
+Subproject commit 8cb8e83ffb040f25cefa597f21608ca6a64aed70

+ 1
- 0
bundle/vim-toml

@@ -0,0 +1 @@
1
+Subproject commit 2295e612d936671048035dbc447f5400cbee60de

+ 1
- 0
bundle/yaml-vim

@@ -0,0 +1 @@
1
+Subproject commit 509eef523082d69a75652739d4e7e6068eeb6506

+ 74
- 0
colors/fruidle.vim View File

@@ -0,0 +1,74 @@
1
+" Vim color file
2
+" Maintainer: Andrés Suárez <ansuga@gmail.com> 
3
+" Last Change: 2009/02/10 Tue 16:55
4
+"     version: 1.2
5
+" This color scheme uses a light background.
6
+
7
+set background=light
8
+hi clear
9
+if exists("syntax_on")
10
+   syntax reset
11
+endif
12
+
13
+let colors_name = "fruidle"
14
+
15
+" Normal
16
+hi Normal       guifg=#404040 guibg=#ffffff
17
+
18
+" Search
19
+hi IncSearch    gui=UNDERLINE guifg=#404040 guibg=#40ffff
20
+hi Search       gui=NONE guifg=#404040 guibg=#ffff60
21
+
22
+" Messages
23
+hi ErrorMsg     gui=NONE guifg=#ff0000 guibg=#ffe4e4
24
+hi WarningMsg   gui=NONE guifg=#ff0000 guibg=#ffe4e4
25
+hi ModeMsg      gui=NONE guifg=#dd0000 guibg=NONE
26
+hi MoreMsg      gui=NONE guifg=#009070 guibg=NONE
27
+hi Question     gui=NONE guifg=#ff7700 guibg=NONE
28
+
29
+" Split area
30
+hi StatusLine   gui=BOLD guifg=#f8f8f8 guibg=#404040
31
+hi StatusLineNC gui=NONE guifg=#a4a4a4 guibg=#404040
32
+hi VertSplit    gui=NONE guifg=#f8f8f8 guibg=#404040
33
+hi WildMenu     gui=BOLD guifg=#f8f8f8 guibg=#dd0000
34
+
35
+" Diff
36
+hi DiffText     gui=NONE guifg=#e04040 guibg=#ffd8d8
37
+hi DiffChange   gui=NONE guifg=#408040 guibg=#d0f0d0
38
+hi DiffDelete   gui=NONE guifg=#4848ff guibg=#ffd0ff
39
+hi DiffAdd      gui=NONE guifg=#4848ff guibg=#ffd0ff
40
+
41
+" Cursor
42
+hi Cursor       gui=NONE guifg=#0000ff guibg=#00e0ff
43
+hi lCursor      gui=NONE guifg=#f8f8f8 guibg=#8000ff
44
+hi CursorIM     gui=NONE guifg=#f8f8f8 guibg=#8000ff
45
+
46
+" Fold
47
+hi Folded       gui=NONE guifg=#20605c guibg=#b8e8dc
48
+hi FoldColumn   gui=NONE guifg=#40a098 guibg=#f0f0f0
49
+
50
+" Other
51
+hi Directory    gui=NONE guifg=#0070b8 guibg=NONE
52
+hi LineNr       gui=NONE guifg=#acacac guibg=NONE
53
+hi NonText      gui=BOLD guifg=#00a0c0 guibg=#ececec
54
+hi SpecialKey   gui=NONE guifg=#4040ff guibg=NONE
55
+hi Title        gui=NONE guifg=#0050a0 guibg=#c0e8ff
56
+hi Visual       gui=NONE guifg=#484848 guibg=#e0e0e0
57
+" hi VisualNOS    gui=NONE guifg=#484848 guibg=#e0e0e0
58
+
59
+" Syntax group
60
+hi Comment      gui=NONE guifg=#dd0000 guibg=NONE
61
+hi Constant     gui=NONE guifg=#0070e6 guibg=NONE
62
+hi Number       gui=NONE guifg=#aa0094 guibg=NONE
63
+hi Identifier   gui=NONE guifg=#0070e6 guibg=NONE
64
+hi Error        gui=BOLD guifg=#ffffff guibg=#dd0000
65
+hi Ignore       gui=NONE guifg=#f8f8f8 guibg=NONE
66
+hi PreProc      gui=BOLD guifg=#e06800 guibg=NONE
67
+hi Special      gui=NONE guifg=#4a9400 guibg=NONE
68
+hi Statement    gui=NONE guifg=#ff7700 guibg=NONE
69
+hi Todo         gui=UNDERLINE guifg=#ff0070 guibg=#ffe0f4
70
+hi Type         gui=BOLD guifg=#0070e6 guibg=NONE
71
+hi Underlined   gui=UNDERLINE guifg=fg guibg=NONE
72
+hi Include      gui=BOLD guifg=#dd0000 guibg=NONE 
73
+hi Function     gui=BOLD guifg=#00aa00 guibg=NONE
74
+hi String       gui=NONE guifg=#00aa00 ctermfg=1

+ 65
- 0
ftplugin/python.vim View File

@@ -0,0 +1,65 @@
1
+setlocal expandtab
2
+setlocal colorcolumn=88
3
+setlocal textwidth=88
4
+" Enable comment continuation.
5
+" setlocal formatoptions+=cro
6
+" setlocal foldmethod=indent
7
+" setlocal foldminlines=10
8
+" setlocal textwidth=0
9
+
10
+" Multi-line commenting and uncommenting.
11
+vmap <buffer> <C-m> :s/^\(\s*\)/\1#/<Return>
12
+vmap <buffer> <C-,> :s/^\(\s*\)#/\1/<Return>
13
+
14
+" Use the AutoPythonImport tool.
15
+map <buffer> <C-n> :call AutoPythonImport(expand("<cword>"))<Return>
16
+
17
+" Change the line length for Python files based on configuration files.
18
+function! ChangePythonLineLength() abort
19
+    let l:conf = ale#path#FindNearestFile(bufnr(''), 'setup.cfg')
20
+    " Reset settings back to defaults when configuration files are not found
21
+    let l:line_length = 79
22
+
23
+    if !empty(l:conf)
24
+        for l:match in ale#util#GetMatches(
25
+        \   readfile(l:conf),
26
+        \   '\v^ *max-line-length *\= *(\d+)',
27
+        \)
28
+            let l:line_length = str2nr(l:match[1])
29
+        endfor
30
+    endif
31
+
32
+    let &l:colorcolumn = l:line_length + 1
33
+endfunction
34
+
35
+call ChangePythonLineLength()
36
+
37
+let b:ale_linters = ['flake8']
38
+let b:ale_fixers = [
39
+\   'remove_trailing_lines',
40
+\   'autopep8',
41
+\   'yapf',
42
+\]
43
+let b:ale_completion_excluded_words = ['and', 'or', 'if']
44
+
45
+if expand('%:e') is# 'pyi'
46
+    let b:ale_linters = ['mypy']
47
+endif
48
+
49
+map <buffer> <silent> <F9> :TestFile<CR>
50
+
51
+let s:virtualenv = ale#python#FindVirtualenv(bufnr(''))
52
+
53
+if !empty(s:virtualenv)
54
+    if executable(s:virtualenv . '/bin/pytest')
55
+        let g:test#python#runner = 'pytest'
56
+        let g:test#python#pytest#executable =
57
+        \   ale#path#CdString(ale#path#Dirname(s:virtualenv))
58
+        \   . ale#Escape(s:virtualenv . '/bin/pytest')
59
+    else
60
+        let g:test#python#runner = 'djangotest'
61
+        let g:test#python#djangotest#executable =
62
+        \   ale#Escape(s:virtualenv . '/bin/python')
63
+        \   . ' ' . ale#Escape(ale#path#Dirname(s:virtualenv) . '/manage.py') . ' test'
64
+    endif
65
+endif

+ 302
- 0
vimrc View File

@@ -0,0 +1,302 @@
1
+let $VIMHOME = expand('~/.vim')
2
+" check if in tty
3
+let g:is_tty = system('case $(tty) in (/dev/tty[0-9]) echo 1;; (*) echo 0;; esac')
4
+
5
+" vim-plug init
6
+if empty(glob('~/.vim/autoload/plug.vim'))
7
+  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
8
+    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
9
+  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
10
+endif
11
+
12
+call plug#begin('~/.vim/bundle')
13
+
14
+""" Install Plugs
15
+
16
+" Deoplete.vim
17
+Plug 'Shougo/deoplete.nvim'
18
+Plug 'roxma/nvim-yarp'
19
+Plug 'roxma/vim-hug-neovim-rpc'
20
+let g:deoplete#enable_at_startup = 1
21
+
22
+" fzf
23
+Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
24
+Plug 'junegunn/fzf.vim'
25
+
26
+" NERDTree
27
+Plug 'scrooloose/nerdtree'
28
+Plug 'Xuyuanp/nerdtree-git-plugin'
29
+
30
+" tagbar
31
+Plug 'majutsushi/tagbar'
32
+
33
+" vim-fugitive
34
+Plug 'tpope/vim-fugitive'
35
+
36
+" ALE
37
+Plug 'w0rp/ale'
38
+
39
+" vim-airline
40
+Plug 'vim-airline/vim-airline'
41
+Plug 'vim-airline/vim-airline-themes'
42
+
43
+" Colorschemes
44
+Plug 'junegunn/seoul256.vim'
45
+Plug 'scwood/vim-hybrid'
46
+Plug 'kristijanhusak/vim-hybrid-material'
47
+Plug 'srcery-colors/srcery-vim'
48
+Plug 'nightsense/cosmic_latte'
49
+Plug 'rafi/awesome-vim-colorschemes'
50
+
51
+" Dockerfile.vim
52
+Plug 'ekalinin/Dockerfile.vim'
53
+
54
+" YAML
55
+Plug 'mrk21/yaml-vim'
56
+
57
+" Python
58
+Plug 'ambv/black'
59
+
60
+" TOML
61
+Plug 'cespare/vim-toml'
62
+
63
+" Autoclose
64
+Plug 'jiangmiao/auto-pairs'
65
+
66
+" vim-go
67
+Plug 'fatih/vim-go'
68
+
69
+" vim-multiple-cursor
70
+Plug 'terryma/vim-multiple-cursors'
71
+
72
+" rust.vim
73
+Plug 'rust-lang/rust.vim'
74
+
75
+call plug#end()
76
+
77
+"""
78
+
79
+""" ALE configuration
80
+
81
+let g:ale_sign_error = '->'
82
+let g:ale_sign_warning = '~>'
83
+
84
+let g:deoplete#sources = {'_': ['ale']}
85
+let g:ale_completion_enabled = 1
86
+
87
+let g:ale_linters = {
88
+\   'javascript': ['eslint'],
89
+\   'golang': ['gopls', 'gofmt'],
90
+\   'python': ['flake8', 'python-language-server'],
91
+\   'rust': ['cargo'],
92
+\}
93
+
94
+let g:ale_fixers = {
95
+\   'javascript': ['prettier'],
96
+\   'golang': ['gopls', 'gofmt', 'goimports'],
97
+\   'python': ['black', 'python-language-server'],
98
+\   'rust': ['cargo'],
99
+\}
100
+
101
+let g:ale_echo_msg_error_str = 'Err'
102
+let g:ale_echo_msg_warning_str = 'Warn'
103
+let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
104
+
105
+let g:ale_go_langserver_executable = 'gopls'
106
+
107
+""" Themes and colors
108
+
109
+set term=linux
110
+set t_Co=256
111
+set background=dark
112
+colorscheme hybrid_reverse 
113
+let g:airline_theme='hybrid'
114
+set number
115
+let g:enable_bold_font = 1
116
+let g:enable_italic_font = 1
117
+
118
+" air-line
119
+let g:airline_powerline_fonts = 1
120
+
121
+if !exists('g:airline_symbols') && !g:is_tty
122
+    let g:airline_symbols = {}
123
+    endif
124
+
125
+    " unicode symbols
126
+    let g:airline_left_sep = ''
127
+    let g:airline_left_alt_sep = ''
128
+    let g:airline_right_sep = ''
129
+    let g:airline_right_alt_sep = ''
130
+    let g:airline_symbols.branch = ''
131
+    let g:airline_symbols.readonly = ''
132
+    let g:airline_symbols.linenr = ''"
133
+    " let g:airline_symbols.branch = '⎇'
134
+    let g:airline_symbols.paste = 'ρ'
135
+    " let g:airline_symbols.paste = 'Þ'
136
+    " let g:airline_symbols.paste = '∥'
137
+    let g:airline_symbols.whitespace = 'Ξ'
138
+
139
+
140
+""" FZF
141
+
142
+let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
143
+
144
+let g:fzf_action = {
145
+\	'ctrl-t': 'tabedit',
146
+\	'ctrl-v': 'vsplit',
147
+\	'ctrl-x': 'split' }
148
+let g:fzf_buffers_jump = 1
149
+
150
+let g:fzf_commands_expect = 'alt-enter,ctrl-x'
151
+
152
+""" NERDTree
153
+
154
+" Close NERDTree automatically after opening a file with it.
155
+let g:NERDTreeQuitOnOpen = 1
156
+" Use a single click for opening things in NERDTree
157
+let g:NERDTreeMouseMode = 3
158
+let g:NERDTreeMapActivateNode = '<Space>'
159
+let g:NERDTreeIgnore = [
160
+\   '\.pyc$',
161
+\   '^__pycache__$',
162
+\]
163
+
164
+" ripgrep
165
+if executable('rg')
166
+  let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"'
167
+  set grepprg=rg\ --vimgrep
168
+  command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
169
+endif
170
+
171
+" Search in files with ripgrep + preview with bat 
172
+function! Fzf_dev()
173
+  let l:fzf_files_options = '--preview "bat --style=numbers,changes --color always {2..-1} | head -'.&lines.'"'
174
+
175
+  function! s:files()
176
+    let l:files = split(system($FZF_DEFAULT_COMMAND), '\n')
177
+    return s:format_list(l:files)
178
+  endfunction
179
+
180
+  function! s:format_list(candidates)
181
+    let l:result = []
182
+    for l:candidate in a:candidates
183
+      let l:filename = fnamemodify(l:candidate, ':p:t')
184
+      let l:icon = ">-" 
185
+      call add(l:result, printf('%s %s', l:icon, l:candidate))
186
+    endfor
187
+
188
+    return l:result
189
+  endfunction
190
+
191
+  function! s:edit_file(item)
192
+    let l:pos = stridx(a:item, ' ')
193
+    let l:file_path = a:item[pos+1:-1]
194
+    execute 'silent e' l:file_path
195
+  endfunction
196
+
197
+  call fzf#run({
198
+        \ 'source': <sid>files(),
199
+        \ 'sink':   function('s:edit_file'),
200
+        \ 'options': '-m ' . l:fzf_files_options,
201
+        \ 'down':    '40%' })
202
+endfunction
203
+
204
+""" general
205
+
206
+set nospell
207
+
208
+packloadall
209
+
210
+silent! helptags ALL
211
+
212
+" Enable persistent undo
213
+set undodir=$VIMHOME/.undo//
214
+set undofile
215
+set undolevels=1000 "maximum number of changes that can be undone
216
+set undoreload=10000 "maximum number lines to save for undo on a buffer reload
217
+
218
+" Automatically re-open files after they have changed without prompting.
219
+" This can be a little more destructive, but a lot less annoying.
220
+set autoread
221
+
222
+set autochdir
223
+set autoindent
224
+set showmatch
225
+
226
+" Put all special files in the right place
227
+set backupdir=$VIMHOME/.backup//
228
+set directory=$VIMHOME/.swp//
229
+
230
+" Draw tabs and trailing spaces.
231
+" set listchars=tab:<->
232
+set listchars=tab:›\ ,trail:•,extends:#,nbsp:. 
233
+set list
234
+
235
+" Set the right margin.
236
+set colorcolumn=89
237
+" Automatically split words at the margin.
238
+set wrap
239
+
240
+" Default to spaces instead of tabs
241
+set expandtab
242
+
243
+" Set tab width to 4.
244
+set tabstop=4
245
+set shiftwidth=4
246
+" Setting this will make backspace delete space indents
247
+set softtabstop=4
248
+
249
+" Disable automatic wrapping.
250
+set textwidth=0
251
+
252
+" Make :Q and :W work like :q and :w
253
+command! W w
254
+command! Q q
255
+
256
+" Make completion smarter.
257
+set ignorecase
258
+set smartcase
259
+
260
+" viminfo settings
261
+" '100 : Remember marks for 100 previously edited files.
262
+" <50  : ???
263
+" s10  : ???
264
+" h    : ???
265
+" "100 : Save 100 lines for each register
266
+" :50  : Remember 50 lines of command history
267
+set viminfo='100,<50,s10,h,\"100,:50
268
+
269
+" Jump at last opened cursor position position, if valid
270
+if has("autocmd")
271
+  au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
272
+    \| exe "normal! g'\"" | endif
273
+endif
274
+
275
+" Warn about not being able to write to .viminfo, which messes up restoring
276
+" the cursor position when editing.
277
+let s:info_filename = expand('~/.viminfo')
278
+
279
+if !empty(glob(s:info_filename)) && !filewritable(s:info_filename)
280
+    echoerr 'The .viminfo file cannot be written to!'
281
+endif
282
+
283
+
284
+""" keybindings
285
+
286
+let mapleader = ','
287
+nnoremap <silent> <C-d> :bd<CR>
288
+nnoremap <C-e> :NERDTree<CR>
289
+nnoremap <C-h> <C-w><Left>
290
+nnoremap <C-j> <C-w><Down>
291
+nnoremap <C-k> <C-w><Up>
292
+nnoremap <C-l> <C-w><Right>
293
+nnoremap <C-t> :Tagbar<CR>
294
+nnoremap <leader>b :Gblame<CR>
295
+nnoremap <C-p> :FZF<CR>
296
+nnoremap <C-a> :Buffers<CR>
297
+nnoremap <C-F> :Files<CR>
298
+nnoremap <C-\> :Rg<CR>
299
+nnoremap <leader>\ :call Fzf_dev()<CR>
300
+nnoremap <leader>c :Commits
301
+map <leader><Tab> :bnext<CR>
302
+map <leader><S-Tab> :bprev<CR>

Loading…
Cancel
Save