rc

Changed 'set number' to 'set relativenumber'.

Author
Vngngdn
Date
July 11, 2016, 11:34 a.m.
Hash
c9604cc4644ee4569f03ee6681f25e06984101a4
Parent
93b744b8b54032f7682b1ed108289e402c867ff2
Modified files
.vimrc
music.py

.vimrc

1 addition and 1 deletion.

View changes Hide changes
1
1
"I'll most certainly add comments to every fucking line I write. It goes without saying that I need to know what every line does.
2
2
3
3
" VUNDLE {{{
4
4
"Vundle is used to manage plugins for Vim. It needs additional setup, so it gets priority in my .vimrc.
5
5
6
6
filetype off                  " required
7
7
8
8
" set the runtime path to include Vundle and initialize
9
9
set rtp+=~/.vim/bundle/Vundle.vim
10
10
call vundle#begin()
11
11
12
12
" let Vundle manage Vundle, required
13
13
Plugin 'VundleVim/Vundle.vim'
14
14
15
15
" YCM is a plugin that allows Vim semantic type checking and more programming mumbo jumbo. It is godlike and it must always be there for me.
16
16
" XXX: This might be removed in favor of Deoplete. It depends on whether
17
17
" Deoplete is better or not.
18
18
Plugin 'Valloric/YouCompleteMe'
19
19
20
20
" Airline provides a neat and feature rich status bar. Really nice to have.
21
21
Plugin 'bling/vim-airline'
22
22
23
23
" Bufferline will show buffers in the status bar. There's enough room anyway, so I fancied having it.
24
24
Plugin 'bling/vim-bufferline'
25
25
26
26
" Syntastic does automatic syntax checking without the need to compile.
27
27
" XXX: Might be replaced in the future in favor of Neomake, because it's
28
28
" asynchronous, and I only use NeoVim these days, honestly.
29
29
Plugin 'scrooloose/syntastic'
30
30
31
31
" A fuzzy searcher. Just CTRL+P and BAM all your files are visible.
32
32
Plugin 'kien/ctrlp.vim'
33
33
34
34
" This plugin enables Git intergration.
35
35
Plugin 'tpope/vim-fugitive'
36
36
37
37
" This provides snippets for redundant code. Praise the hackers man.
38
38
Plugin 'SirVer/ultisnips'
39
39
40
40
" In addition to UltiSnips, this plugin contains a prefetched repository of snippets. Must have, because I'm not planning on writing all of those by myself.
41
41
Plugin 'honza/vim-snippets'
42
42
43
43
" Rust syntax files, including Syntastic integration:
44
44
Plugin 'rust-lang/rust.vim'
45
45
46
46
" All of your Plugins must be added before the following line
47
47
call vundle#end()            " required
48
48
filetype plugin indent on    " required
49
49
" To ignore plugin indent changes, instead use:
50
50
"filetype plugin on
51
51
"
52
52
" Brief help
53
53
" :PluginList       - lists configured plugins
54
54
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
55
55
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
56
56
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
57
57
"
58
58
" see :h vundle for more details or wiki for FAQ
59
59
" Put your non-Plugin stuff after this line
60
60
" }}}
61
61
62
62
" YOUCOMPLETEME {{{
63
63
" YouCompleteMe is a godlike completer for Vim. As such, it is worthy of its own section.
64
64
" However, I'll be trying out Deoplete in the future, which might render it
65
65
" obsolete. Until further notice, I'm keeping this beauty.
66
66
"
67
67
" This setting will force YCM to close the preview buffer after selecting the completion.
68
68
let g:ycm_autoclose_preview_window_after_completion=1
69
69
70
70
" Sets the symbol used to indicate a syntax error:
71
71
let g:ycm_error_symbol = '>>'
72
72
73
73
" Sets the symbol used to indicate a warning:
74
74
let g:ycm_warning_symbol = 'i'
75
75
76
76
" Fills the identifier completion database with the language's keywords (e.g., when starting a new Java file, "class" will already be in the completion engine.
77
77
let g:ycm_seed_identifiers_with_syntax=0
78
78
79
79
" This setting tells YCM what keys to use to accept completion. I removed <Down> as default, because I'm a silly coder and still use my arrow keys to navigate my source files. Hey, years of negligence for Vim leaves its marks. To think I ever thought Notepad++ was the best editor ever, the fuck...
80
80
let g:ycm_key_list_select_completion=['<TAB>']
81
81
82
82
" Same reason; I'm a dumb fuck and arrows are still hardwired in my brain.
83
83
let g:ycm_key_list_previous_completion=['<S-TAB>']
84
84
85
85
" }}}
86
86
87
87
" AIRLINE {{{
88
88
" Airline is a great status bar plugin. Although it can behave quirky if Powerline is not on the scene. These scripts are dedicated to handle that behavior.
89
89
90
90
91
91
92
92
" These lines will load the powerline font for use in Airline.
93
93
if !exists('g:airline_symbols')
94
94
		let g:airline_symbols={}
95
95
endif
96
96
let g:airline_symbols.space="\ua0"
97
97
let g:airline_powerline_fonts=1
98
98
99
99
" If there is only one tab opened, the tab bar will display the different buffers.
100
100
let g:airline#extensions#tabline#enabled=1
101
101
102
102
" Makes Airline appear immediately, instead of waiting for a split.
103
103
set laststatus=2
104
104
" }}}
105
105
106
106
" ULTISNIPS {{{
107
107
" As mentioned earlier, this provides snippets to stop redundant code.
108
108
109
109
" To begin, changing default TAB, because YCM already uses TAB.
110
110
	let g:UltiSnipsExpandTrigger="<c-l>"
111
111
	let g:UltiSnipsJumpForwardTrigger="<c-j>"
112
112
	let g:UltiSnipsJumpBackwardTrigger="<c-k>"
113
113
114
114
" }}} 
115
115
"
116
116
" COLOURS & COLORS {{{
117
117
118
118
colorscheme molokai " I like molokai. I've used badwolf, but I like popping colors.
119
119
120
120
" }}}
121
121
122
122
" SPACES & TABS {{{
123
123
124
124
" The number of visual spaces per TAB hit.
125
125
set tabstop=4
126
126
127
127
" Setting the amount of tabs to 4. The default is 8.
128
128
set shiftwidth=4
129
129
130
130
" This breaks lines after column 80.
131
131
set textwidth=80
132
132
" }}}
133
133
134
134
" UI CONFIGURATION {{{
135
135
136
136
set number " Sets line numbers. Seriously Neovim, isn't this default yet?
137
-
set cursorline " Highlights the line currently selected by the cursor.
+
137
set cursorline " Highlights the line currently selected by the cursor.
138
138
filetype indent on " Detects filetype on load, and loads the appropriate syntax file.
139
139
" This highlights the matching parenthesis ([, {, (, ...). I think this is default, but in case it's not, tadaa.
140
140
set showmatch " Highlights matching parenthesis on hover ("[, {, ...").
141
141
" }}}
142
142
143
143
" SEARCHING {{{
144
144
145
145
" Problem with hlsearch is that it does not turn off the highlighting. So searching for vowels may quickly result in everything being highlighted. This is a mapping. It will remove highlighting when entering \<SPACE>
146
146
nnoremap <leader><space> :nohlsearch<CR>
147
147
" }}}
148
148
149
149
" FOLDING {{{
150
150
" In case I forget (I'm Belgian), folding is hiding code parts that belong together, like functions. Très important. Fuck azerty.
151
151
152
152
" This enables folding as is.
153
153
set foldenable
154
154
155
155
" This setting determines how many folds have to be opened. The number indicates the folding level. So 0 = every possible folding is folded. 99 = practically everything is open. I'm using 10, since I already have a problem with more than 3 nested loops.
156
156
set foldlevelstart=10
157
157
158
158
" This setting blocks overuse of nested foldings. I don't know how this will turn out in LISP/Scheme, but I'll be damned if this setting does more harm than good.
159
159
set foldnestmax=10
160
160
161
161
" This setting is commented by default, but included in case I start to grow hate for the current way Vim handles folding (za). It basically maps that command to spacebar. I may map it to z because then I only have to type one letter and RETURN, that's 33% of my time saved! =3
162
162
"nnoremap <space> za
163
163
164
164
" }}}
165
165
166
166
" MOVEMENT {{{
167
167
168
168
" When you go up, and you have a line going over multiple lines because it's too long, the standard mapping will skip that. These two settings will block that behaviour.
169
169
nnoremap j gj
170
170
nnoremap k gk
171
171
" }}}
172
172
173
173
" BACKING UP {{{
174
174
175
175
" What these lines do, is move the backup files to the /tmp folder. This will keep my directories clean and neat.
176
176
set backup
177
177
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
178
178
set backupskip=/tmp/*,/private/tmp/*
179
179
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
180
180
set writebackup
181
181
" }}}
182
182
"
183
183
" NEOVIM {{{
184
184
" While it certainly is an improvement over 'vanilla' Vim, it does some things
185
185
" that keep me from using Vim as it's supposed to be; limited to no mouse usage.
186
186
" So I disable it. I'll enable it again when I've twisted my mind far enough to
187
187
" not touch my mouse again. (Not to mention some terminals don't support mouse
188
188
" control, so it's a bad habit nonetheless if you spend all your time on
189
189
" GNU/Linux distros)
190
190
set mouse=""
191
191
" }}}
192
192
"
193
193
" MACROS {{{
194
194
" }}}
195
195
" OTHER IMPORTANT STUFF {{{
196
196
197
197
198
198
" I found this gem on Reddit. If I'm editing a file that's read only, and I started Vim without sudo, then this little line will do just that for me. All I have to do is use "w!!" when saving.
199
199
" Extensive explanation can also be found at https://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work#7078429
200
200
cmap w!! w !sudo tee > /dev/null %
201
201
202
202
203
203
" This setting will allow me to switch to another buffer without need to save the current buffer.
204
204
set hidden
205
205
" }}}
206
206
207
207
" Because Vim can fold vimrc files with the right syntax, These lines will tell Vim how to handle that.
208
208
set modelines=2 "This tells Vim that the last 2 lines of this file should only apply to this file.
209
209
" So as you can see, the last 2 lines get a special vim:-prefix, so Vim knows for sure this is what's important.
210
210
" To wrap a new section, look at the other sections, and copy that syntax.
211
211
" vim:foldmethod=marker
212
212
" vim:foldlevel=0
213
213

music.py

24 additions and 1 deletion.

View changes Hide changes
1
1
music.py is a little script I made that allows to easily download my music
2
2
from my main computer (Which has more storage space than my laptop) in a
3
3
fashionable way. It uses SFTP through the Paramiko library
4
4
(https://github.com/paramiko/paramiko).
5
5
6
6
The functionality can be expressed as follows:
7
7
    - On the remote music directory, the music is divided in subfolders,
8
8
      according to (main) performing artist. In there, there will either be more
9
9
      subfolders (which would be albums)
10
10
# Importing necessary libraries
+
11
      FLAC and ogg, with a certain name. There may also be files with the same
+
12
      name, but with another filetype, like .ogv.
+
13
    - Video files serve as the videoclips for said music files. If there is no
+
14
      music file, it's assumed the music file is the same as the video file,
+
15
      less the video itself.
+
16
    - There may also be subtitle files, like .srt which will store the lyrics of
+
17
      said song.
+
18
"""
+
19
+
20
# Importing necessary libraries
11
21
import paramiko
12
22
13
23
# Defining constant values for use throughout the program
14
24
NAME = "maarten"  # Name to be used on the remote server.
15
25
LOCAL_MUSIC_DIRECTORY = "~/Music/"
16
26
REMOTE_MUSIC_DIRECTORY = "~/Muziek/"  # I blame being Belgian.
17
27
"""
18
-
19
28
key = paramiko.RSAKey(data=base64.decodestring('AAA...'))
+
29
client = paramiko.SSHClient()
+
30
client.get_host_keys().add('ssh.example.com', 'ssh-rsa', key)
+
31
+
32
def connect_to_server(serverAddress, userName, passphrase):
+
33
    pass
+
34
+
35
serverAddress = "maartenv.be"
+
36
+
37
client.connect('ssh.example.com', username='strongbad', password='thecheat')
+
38
stdin, stdout, stderr = client.exec_command('ls')
+
39
for line in stdout:
+
40
    print '... ' + line.strip('\n')
+
41
client.close()
+
42