nvim stuff and tmux
This commit is contained in:
parent
4786ecae6e
commit
d163ca7a19
|
@ -11,4 +11,4 @@ keymap('n', '<F5>', ":w<CR>:exec '!clear;python' shellescape(@%, 1)<CR>", defaul
|
|||
|
||||
-- Handy stuff
|
||||
keymap('n', '<Leader>m', 'iif __name__ == "__main__":<Esc>o<Tab>main()<Esc>o<Bs><Bs><Esc>', default_ops)
|
||||
keymap('n', '<Leader>f', 'idef ():<Esc>bi', default_ops)
|
||||
-- keymap('n', '<Leader>f', 'idef ():<Esc>bi', default_ops)
|
||||
|
|
|
@ -9,6 +9,10 @@ keymap('n', '<F2>', ':wq<CR>', default_ops)
|
|||
keymap('n', '[b', ':bp<CR>', default_ops)
|
||||
keymap('n', ']b', ':bn<CR>', default_ops)
|
||||
|
||||
-- Enter lines
|
||||
keymap('n', '<Enter>', 'o<Esc>', default_ops)
|
||||
keymap('n', '<s-Enter>', 'O<Esc>', default_ops)
|
||||
|
||||
-- Folding
|
||||
keymap('n', '<space>', 'za', default_ops)
|
||||
-- keymap('n', '<space>', 'za', default_ops)
|
||||
|
|
|
@ -34,5 +34,11 @@ return require('packer').startup(function(use)
|
|||
use('ncm2/ncm2-path') -- Path completion
|
||||
use('ncm2/ncm2-jedi') -- Python completion
|
||||
|
||||
-- Slime, for tmux repl-ing
|
||||
use('jpalardy/vim-slime')
|
||||
|
||||
-- Telescope, fuzzy finding
|
||||
use('nvim-lua/plenary.nvim')
|
||||
use('nvim-telescope/telescope.nvim')
|
||||
|
||||
end)
|
||||
|
|
|
@ -21,3 +21,9 @@ settings.foldmethod = "indent"
|
|||
settings.foldnestmax = 99
|
||||
settings.foldlevelstart = 99
|
||||
|
||||
-- slime
|
||||
vim.g.slime_target = 'tmux'
|
||||
vim.g.slime_default_config = {
|
||||
socket_name = vim.api.nvim_eval('get(split($TMUX, ","), 0)'),
|
||||
target_pane = '{bottom}',
|
||||
}
|
||||
|
|
|
@ -157,6 +157,14 @@ opacity-rule = [ "10:class_g = 'alacritty'"];
|
|||
# Background-Blurring #
|
||||
#################################
|
||||
|
||||
experimental-backend = true;
|
||||
|
||||
blur: {
|
||||
method = "dual_kawase";
|
||||
strength = 10;
|
||||
blur-background = true;
|
||||
};
|
||||
|
||||
|
||||
# Parameters for background blurring, see the *BLUR* section for more information.
|
||||
# blur-method =
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
# remap prefix from 'C-b' to 'C-a'
|
||||
unbind C-b
|
||||
set-option -g prefix C-a
|
||||
bind-key C-a send-prefix
|
||||
|
||||
# 0 is too far from Ctrl-a.
|
||||
set -g base-index 1
|
||||
|
||||
# 1-indexed panes to match the windows.
|
||||
setw -g pane-base-index 1
|
||||
|
||||
# Look nice.
|
||||
set -g default-terminal screen-256color
|
||||
|
||||
# split panes using | and -
|
||||
bind | split-window -h
|
||||
bind - split-window -v
|
||||
unbind '"'
|
||||
unbind %
|
||||
|
||||
# reload config file (change file location to your the tmux.conf you want to use)
|
||||
bind r source-file ~/.tmux.conf\; display ' Reloaded tmux config.'
|
||||
|
||||
# switch panes using Alt-arrow without prefix
|
||||
bind -n M-Left select-pane -L
|
||||
bind -n M-Right select-pane -R
|
||||
bind -n M-Up select-pane -U
|
||||
bind -n M-Down select-pane -D
|
||||
|
||||
# Shift + arrow key to move between windows.
|
||||
bind-key -n S-Left previous-window
|
||||
bind-key -n S-Right next-window
|
|
@ -4,7 +4,7 @@ set shiftwidth=4 tabstop=4 softtabstop=4 expandtab autoindent smartindent
|
|||
" Right-most border
|
||||
set colorcolumn=80
|
||||
|
||||
setlocal path=.,**
|
||||
" setlocal path=.,**
|
||||
setlocal wildignore=*.pyc
|
||||
|
||||
" if name equals main
|
||||
|
|
57
vimrc/.vimrc
57
vimrc/.vimrc
|
@ -23,14 +23,44 @@ let $RC="$HOME/.vimrc"
|
|||
set path=.,**
|
||||
|
||||
" Plugin stuff
|
||||
execute pathogen#infect()
|
||||
call plug#begin()
|
||||
" Colors and stuff
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'dikiaap/minimalist'
|
||||
Plug 'jacoborus/tender.vim'
|
||||
Plug 'jpo/vim-railscasts-theme'
|
||||
Plug 'rainux/vim-desert-warm-256'
|
||||
Plug 'morhetz/gruvbox'
|
||||
Plug 'ayu-theme/ayu-vim'
|
||||
" NerdTree stuff
|
||||
Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }
|
||||
Plug 'Xuyuanp/nerdtree-git-plugin'
|
||||
Plug 'ryanoasis/vim-devicons'
|
||||
Plug 'ervandew/supertab'
|
||||
" Auto-complete:
|
||||
Plug 'ncm2/ncm2'
|
||||
Plug 'roxma/nvim-yarp'
|
||||
" enable ncm2 for all buffers
|
||||
autocmd BufEnter * call ncm2#enable_for_buffer()
|
||||
" IMPORTANT: :help Ncm2PopupOpen for more information
|
||||
set completeopt=noinsert,menuone,noselect
|
||||
" NOTE: you need to install completion sources to get completions. Check
|
||||
" our wiki page for a list of sources: https://github.com/ncm2/ncm2/wiki
|
||||
Plug 'ncm2/ncm2-bufword'
|
||||
Plug 'ncm2/ncm2-path'
|
||||
Plug 'ncm2/ncm2-jedi'
|
||||
call plug#end()
|
||||
|
||||
" Supertab
|
||||
let g:SuperTabMappingForward = '<s-tab>'
|
||||
let g:SuperTabMappingBackward = '<tab>'
|
||||
|
||||
" Always show file name
|
||||
set laststatus=2
|
||||
|
||||
" Enter to insert blank line below current, Shift+Enter to insert above
|
||||
map <Enter> o<ESC>
|
||||
map <S-Enter> O<ESC>
|
||||
map <s-Enter> O<ESC>
|
||||
|
||||
" Folding (move to python specific vim file?)
|
||||
set foldmethod=indent
|
||||
|
@ -40,8 +70,8 @@ nnoremap <space> za
|
|||
vnoremap <space> zf
|
||||
|
||||
" F9 execute current Python file
|
||||
autocmd FileType python map <buffer> <F9> :w<CR>:exec '!clear;python' shellescape(@%, 1)<CR>
|
||||
autocmd FileType python imap <buffer> <F9> <esc>:w<CR>:exec '!clear;python' shellescape(@%, 1)<CR>
|
||||
autocmd FileType python map <buffer> <F5> :w<CR>:exec '!clear;python' shellescape(@%, 1)<CR>
|
||||
autocmd FileType python imap <buffer> <F5> <esc>:w<CR>:exec '!clear;python' shellescape(@%, 1)<CR>
|
||||
|
||||
" Cycle through buffers
|
||||
map [b :bp<CR>
|
||||
|
@ -55,7 +85,6 @@ map <F4> :NERDTreeToggle<CR>
|
|||
map <F1> :w<CR>
|
||||
map <F2> :wq<CR>
|
||||
|
||||
|
||||
" Lint
|
||||
autocmd FileType python map <buffer> gl :w<CR>:exec '!python -m black' shellescape(@%, 1)<CR>
|
||||
|
||||
|
@ -65,19 +94,25 @@ autocmd VimEnter * NERDTree | wincmd p
|
|||
" Exit Vim if NERDTree is the only window remaining in the only tab.
|
||||
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
|
||||
|
||||
|
||||
" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree.
|
||||
autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
|
||||
\ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
|
||||
|
||||
" Open the existing NERDTree on each new tab.
|
||||
autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif
|
||||
|
||||
" Show hidden
|
||||
let NERDTreeShowHidden=1
|
||||
|
||||
|
||||
" Color schemes
|
||||
" colorscheme moonfly
|
||||
" colorscheme onenord
|
||||
" colorscheme gruvbox-baby
|
||||
" colorscheme gruvbox
|
||||
set background=dark
|
||||
colorscheme ayu
|
||||
set termguicolors
|
||||
let ayucolor="dark"
|
||||
" colorscheme tender
|
||||
" colorscheme railscasts
|
||||
" colorscheme desert-warm-256
|
||||
|
||||
" Restore transparent background
|
||||
" highlight Normal guibg=none
|
||||
" highlight NonText guibg=none
|
||||
|
|
Loading…
Reference in New Issue