summaryrefslogtreecommitdiff
path: root/core/vim.sh
diff options
context:
space:
mode:
Diffstat (limited to 'core/vim.sh')
-rwxr-xr-xcore/vim.sh66
1 files changed, 66 insertions, 0 deletions
diff --git a/core/vim.sh b/core/vim.sh
new file mode 100755
index 0000000..bd99a13
--- /dev/null
+++ b/core/vim.sh
@@ -0,0 +1,66 @@
1#!/bin/bash
2
3cd "$(dirname "${BASH_SOURCE[0]}")" || exit
4
5VIMRC_PATH="/etc/vimrc"
6[ -d /etc/vim ] && VIMRC_PATH="/etc/vim/vimrc"
7CLIP_HOST="p.noml.ch"
8CLIP_PORT="5023"
9CLIP_CMD="openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 ${CLIP_HOST} ${CLIP_PORT}"
10
11grep -q 'netcat_clipboard' "$VIMRC_PATH" && exit 0
12
13cat << EOF >> "$VIMRC_PATH"
14augroup netcat_clipboard
15 au!
16 au TextYankPost * call system("echo " . shellescape(@") . " | ${CLIP_CMD} >/dev/null 2>&1 &")
17augroup END
18
19" Enable line wrapping
20set wrap
21
22" Optional: Make wrapped lines easier to read by indenting them
23set breakindent
24set breakindentopt=shift:1
25
26syntax on
27set mouse=a
28set expandtab
29set shiftwidth=4
30set softtabstop=4
31set tabstop=4
32set noautoindent
33set nosmartindent
34filetype plugin indent on
35
36set laststatus=2 " permanent status bar
37set statusline=%F " shows full file path
38
39if (has("termguicolors"))
40 set termguicolors
41endif
42
43"colorscheme murphy
44colorscheme zellner
45
46" Ctrl+A: Move to the beginning of the line in INSERT mode
47inoremap <C-a> <Home>
48
49" Ctrl+E: Move to the end of the line in INSERT mode
50inoremap <C-e> <End>
51
52" Ctrl+A: Move to the beginning of the line in NORMAL mode
53nnoremap <C-a> 0
54
55" Ctrl+E: Move to the end of the line in NORMAL mode
56nnoremap <C-e> $
57
58set number
59setlocal regexpengine=2
60set paste
61set foldcolumn=12
62
63set noswapfile
64autocmd InsertLeave * silent! update
65
66EOF