~pvsr/dotfiles

ref: ce22b82386107d74be4fa5d7010958f75eca1847 dotfiles/nvim/.config/nvim/init.vim -rw-r--r-- 2.1 KiB
ce22b823Peter Rice add some readline shortcuts in insert mode 1 year, 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
let mapleader=" "
nnoremap <space> <nop>

set runtimepath+=~/.local/share/dein/repos/github.com/Shougo/dein.vim

if dein#load_state('~/.local/share/dein')
    call dein#begin('~/.local/share/dein')

    call dein#add('~/.local/share/dein/repos/github.com/Shougo/dein.vim')
    call dein#load_toml("~/.config/nvim/plugins.toml", {})

    call dein#end()
    call dein#save_state()
endif

if dein#check_install()
    call dein#install()
endif

filetype plugin indent on
syntax enable

set background=dark

" tmux, not sure if this is still necessary
set t_8f=[38;2;%lu;%lu;%lum
set t_8b=[48;2;%lu;%lu;%lum

" transparency
if !has("gui_running")
    highlight Normal ctermbg=NONE guibg=NONE
    highlight NonText ctermbg=NONE guibg=NONE
endif

set termguicolors
set lazyredraw

set number
set relativenumber

set expandtab
set tabstop=2
set shiftwidth=2
set shiftround
set smartindent
set textwidth=80
set colorcolumn=+1
set fo+=l
set list

set hidden

set scrolloff=2
set sidescrolloff=5

set shell=/usr/bin/fish

set splitbelow
set splitright
set equalalways

set confirm
set undofile

set ignorecase
set smartcase

set wildignore=*.o,*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
set wildmode=longest,full
set wildignorecase

set inccommand=nosplit

set shortmess+=c

noremap j gj
noremap k gk

inoremap <C-b> <C-o>h
inoremap <C-f> <C-o>l
inoremap <A-b> <C-o>ge
inoremap <A-f> <C-o>w
inoremap <A-d> <C-o>dw

nnoremap Y y$

nnoremap Q <nop>

cnoremap <C-A> <Home>
cnoremap <C-E> <End>

vnoremap < <gv
vnoremap > >gv

nnoremap <silent> <Leader>c :nohlsearch<CR>

nnoremap <Leader>bd :bdelete<CR>
nnoremap <Leader>bn :bnext<CR>
nnoremap <Leader>bp :bprev<CR>

" window management
nnoremap <A--> <C-W>S
nnoremap <silent> <A-_> :botright split<CR>
nnoremap <A-bar> <C-W>v
nnoremap <silent> <A-\> :vertical botright split<CR>

nnoremap <A-h> <C-W>h
nnoremap <A-j> <C-W>j
nnoremap <A-k> <C-W>k
nnoremap <A-l> <C-W>l

" resume position
augroup LastPosition
    autocmd! BufReadPost *
                \ if line("'\"") > 0 && line("'\"") <= line("$") |
                \   exe "normal! g`\"" |
                \ endif
augroup END

autocmd FileType mail setl tw=72
autocmd FileType netrc setl noundofile noswapfile