Julio Biason
2 years ago
3 changed files with 198 additions and 175 deletions
@ -1,171 +0,0 @@
|
||||
" Colors {{{ |
||||
set t_Co=256 |
||||
set background=dark |
||||
let g:rehash256 = 1 |
||||
color molokai |
||||
" }}} |
||||
|
||||
" Functions {{{ |
||||
" Removes trailing spaces {{{ |
||||
function TrimWhiteSpace() |
||||
%s/\s\+$// |
||||
'' |
||||
endfunction |
||||
" }}} |
||||
|
||||
" Jump to alternate file {{{ |
||||
function JumpToAlternate() |
||||
let l:curr_path = expand("%:h") |
||||
let l:basename = expand("%:t") |
||||
if stridx(basename, "test_") == 0 |
||||
let l:new_file = l:basename[5:strlen(l:basename)] |
||||
else |
||||
let l:new_file = "test_" . l:basename |
||||
endif |
||||
let l:new_file = l:curr_path . '/' . l:new_file " WARN: Unixism |
||||
let l:buffer = bufnr(l:new_file) |
||||
if l:buffer == -1 |
||||
exe 'tabe ' .l:new_file |
||||
else |
||||
call win_gotoid(get(win_findbuf(l:buffer), 0)) |
||||
endif |
||||
endfunction |
||||
" }}} |
||||
" }}} |
||||
|
||||
" Settings for all files {{{ |
||||
set cursorline " highlight the line in which the cursor is |
||||
set foldmethod=marker " folding will use markers |
||||
set nowrap " instead of wrapping the text to the next line, scroll left and right |
||||
set laststatus=2 " Always display the status line |
||||
set showtabline=2 " Always display the tab bar |
||||
set scrolloff=2 " Lines around the cursor that should be visible |
||||
set splitright " Open new vertical splits on the right side, instead of left |
||||
set splitbelow " Opne new horizontal splits below the current on, not on top |
||||
let mapleader=" " " Leader (special character for plugins) is Space |
||||
|
||||
let g:rainbow_active = 1 " This is part of the Rainbow brackets, enabling it globally. |
||||
" }}} |
||||
|
||||
" Mappings {{{ |
||||
nnoremap - :Ex<CR> |
||||
nnoremap <silent> <leader>c :call TrimWhiteSpace()<CR> |
||||
" }}} |
||||
|
||||
" Plugin configuration {{{ |
||||
" Airline {{{ |
||||
let g:airline_theme='minimalist' |
||||
let g:airline#extensions#tabline#enabled = 1 |
||||
let g:airline#extensions#tabline#show_buffers = 0 |
||||
let g:airline#extensions#tabline#show_close_button = 0 |
||||
let g:airline#extensions#tabline#formatter = 'unique_tail' |
||||
" }}} |
||||
|
||||
" Skim {{{ |
||||
nmap <silent> <Leader><Space> :SK<CR> |
||||
" }}} |
||||
|
||||
" Polyglot {{{ |
||||
" let g:polyglot_disabled = ["csv"] |
||||
let g:polyglot_disabled = ['sensible', 'csv'] |
||||
" }}} |
||||
|
||||
" LanguageClient {{{ |
||||
" Available analyzers. |
||||
let g:LanguageClient_serverCommands = { |
||||
\ 'rust': ['rust-analyzer'], |
||||
\ 'python': ['pyls'], |
||||
\ } |
||||
" Display hints in the location list (default is QuickFix, which conflicts |
||||
" with `:grep`). |
||||
let g:LanguageClient_selectionUI = 'location-list' |
||||
let g:LanguageClient_diagnosticsList = 'Location' |
||||
" No signs in the gutter |
||||
let g:LanguageClient_diagnosticsSignsMax = 0 |
||||
|
||||
nnoremap <silent> <leader>] :call LanguageClient#textDocument_definition()<CR> |
||||
nnoremap <silent> <leader>k :call LanguageClient#textDocument_hover()<CR> |
||||
nnoremap <silent> <leader>r :call LanguageClient#textDocument_rename()<CR> |
||||
nnoremap <silent> <leader>f :call LanguageClient#textDocument_codeAction()<CR> |
||||
nnoremap <silent> <leader>? :call LanguageClient_contextMenu()<CR> |
||||
" }}} |
||||
|
||||
" }}} |
||||
|
||||
" Filetype specific configurations {{{ |
||||
" Vim files {{{ |
||||
au FileType vim setlocal noexpandtab " use real tabs |
||||
au FileType vim setlocal tabstop=4 " display tabs as 4 spaces |
||||
au FileType vim setlocal shiftwidth=4 " Use 4 spaces when auto-indenting |
||||
" }}} |
||||
|
||||
" Python {{{ |
||||
au FileType python setlocal number " show line numbers |
||||
au FileType python setlocal expandtab " use spaces instead of tabs |
||||
au FileType python setlocal tabstop=4 " number of spaces to use for indentation |
||||
au FileType python setlocal shiftwidth=4 " number of spaces to use for auto-indentation |
||||
au FileType python setlocal softtabstop=4 " when deleting characters, consider 4 spaces as a tab |
||||
au FileType python setlocal textwidth=79 " max line size |
||||
au FileType python setlocal colorcolumn=80 " put a margin indicator |
||||
au FileType python au BufWritePre <buffer> %s/\s\+$//e " When saving a Python file, remove tailing spaces |
||||
au FileType python nmap <silent> <Leader>a :call JumpToAlternate()<CR> |
||||
" }}} |
||||
|
||||
" CSV files {{{ |
||||
au FileType csv setlocal list " Display special characters, like tabs (for TSV files) |
||||
" }}} |
||||
|
||||
" Rust {{{ |
||||
let g:rustfmt_autosave = 1 " Apply `rustfmt` when saving the file. |
||||
|
||||
au FileType rust setlocal number " show line numbers |
||||
au FileType rust setlocal expandtab " use spaces instead of tabs |
||||
au FileType rust setlocal tabstop=4 " number of spaces to use for indentation |
||||
au FileType rust setlocal shiftwidth=4 " number of spaces to use for auto-indentation |
||||
au FileType rust setlocal softtabstop=4 " when deleting characters, consider 4 spaces as a tab |
||||
au FileType rust setlocal textwidth=79 " max line size |
||||
au FileType rust setlocal colorcolumn=80 " put a margin indicator |
||||
" }}} |
||||
|
||||
" Markdown {{{ |
||||
au FileType markdown setlocal spell " enable spell checking |
||||
au FileType markdown setlocal textwidth=79 " max line size |
||||
au FileType markdown setlocal expandtab " use spaces instead of tabs |
||||
" }}} |
||||
|
||||
" Shell {{{ |
||||
au FileType sh setlocal tabstop=4 " display tabs as 4 spaces |
||||
au FileType sh setlocal shiftwidth=4 " number of spaces to use for auto-indentation |
||||
au FileType sh setlocal softtabstop=4 " when deleting characters, consider 4 spaces as a tab |
||||
" }}} |
||||
|
||||
" SQL {{{ |
||||
au FileType sql setlocal softtabstop=2 |
||||
au FileType sql setlocal shiftwidth=2 |
||||
au FileType sql setlocal tabstop=2 |
||||
" }}} |
||||
|
||||
" HTMLDjango {{{ |
||||
au FileType htmldjango setlocal tabstop=4 |
||||
au FileType htmldjango setlocal shiftwidth=4 |
||||
au FileType htmldjango setlocal softtabstop=4 |
||||
au FileType htmldjango setlocal list |
||||
au FileType htmldjango setlocal et |
||||
" }}} |
||||
|
||||
" HTML {{{ |
||||
au FileType html setlocal tabstop=4 |
||||
au FileType html setlocal shiftwidth=4 |
||||
au FileType html setlocal softtabstop=4 |
||||
au FileType html setlocal list |
||||
au FileType html setlocal et |
||||
" }}} |
||||
" }}} |
||||
|
||||
" GUI configuration {{{ |
||||
set guifont=Cascadia\ Mono:h40 |
||||
let g:neovide_no_idle=v:true |
||||
let g:neovide_fullscreen=v:true |
||||
let g:neovide_cursor_antialiasing=v:true |
||||
let g:neovide_cursor_animation_length=0.05 |
||||
" }}} |
@ -0,0 +1,192 @@
|
||||
keybinds clear-defaults=true { |
||||
normal { |
||||
bind "Ctrl a" { SwitchToMode "tmux"; } |
||||
bind "Alt Down" { MoveFocus "Down"; SwitchToMode "normal"; } |
||||
bind "Alt Up" { MoveFocus "Up"; SwitchToMode "normal"; } |
||||
bind "Alt Left" { MoveFocus "Left"; SwitchToMode "normal"; } |
||||
bind "Alt Right" { MoveFocus "Right"; SwitchToMode "normal"; } |
||||
bind "Alt 1" { GoToTab 1; } |
||||
bind "Alt 2" { GoToTab 2; } |
||||
bind "Alt 3" { GoToTab 3; } |
||||
bind "Alt 4" { GoToTab 4; } |
||||
bind "Alt 5" { GoToTab 5; } |
||||
bind "Alt 6" { GoToTab 6; } |
||||
bind "Alt 7" { GoToTab 7; } |
||||
bind "Alt 8" { GoToTab 8; } |
||||
bind "Alt 9" { GoToTab 9; } |
||||
bind "Alt ?" { EditScrollback; } |
||||
} |
||||
scroll { |
||||
bind "Esc" "q" { SwitchToMode "normal"; } |
||||
bind "j" "Down" { ScrollDown; } |
||||
bind "k" "Up" { ScrollUp; } |
||||
bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; } |
||||
bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; } |
||||
bind "Alt 1" { GoToTab 1; SwitchToMode "normal"; } |
||||
bind "Alt 2" { GoToTab 2; SwitchToMode "normal"; } |
||||
bind "Alt 3" { GoToTab 3; SwitchToMode "normal"; } |
||||
bind "Alt 4" { GoToTab 4; SwitchToMode "normal"; } |
||||
bind "Alt 5" { GoToTab 5; SwitchToMode "normal"; } |
||||
bind "Alt 6" { GoToTab 6; SwitchToMode "normal"; } |
||||
bind "Alt 7" { GoToTab 7; SwitchToMode "normal"; } |
||||
bind "Alt 8" { GoToTab 8; SwitchToMode "normal"; } |
||||
bind "Alt 9" { GoToTab 9; SwitchToMode "normal"; } |
||||
} |
||||
tmux { |
||||
bind "Esc" "q" { SwitchToMode "normal"; } |
||||
bind "Alt ?" { EditScrollback; } |
||||
bind "a" "Ctrl a" { Write 1; SwitchToMode "normal"; } |
||||
bind "z" { ToggleFocusFullscreen; SwitchToMode "normal"; } |
||||
bind "PageUp" { SwitchToMode "scroll"; ScrollUp; } |
||||
bind "Enter" "c" "Ctrl c" { NewTab; SwitchToMode "normal"; } |
||||
bind "p" { GoToPreviousTab; SwitchToMode "normal"; } |
||||
bind "n" { GoToNextTab; SwitchToMode "normal"; } |
||||
bind "-" { NewPane "Down"; SwitchToMode "normal"; } |
||||
bind r"\" { NewPane "Right"; SwitchToMode "normal"; } |
||||
bind "Esc" { SwitchToMode "normal"; } |
||||
bind "Down" "Alt Down" { MoveFocus "Down"; SwitchToMode "normal"; } |
||||
bind "Up" "Alt Up" { MoveFocus "Up"; SwitchToMode "normal"; } |
||||
bind "Left" "Alt Left" { MoveFocus "Left"; SwitchToMode "normal"; } |
||||
bind "Right" "Alt Right" { MoveFocus "Right"; SwitchToMode "normal"; } |
||||
bind "1" { GoToTab 1; SwitchToMode "normal"; } |
||||
bind "2" { GoToTab 2; SwitchToMode "normal"; } |
||||
bind "3" { GoToTab 3; SwitchToMode "normal"; } |
||||
bind "4" { GoToTab 4; SwitchToMode "normal"; } |
||||
bind "5" { GoToTab 5; SwitchToMode "normal"; } |
||||
bind "6" { GoToTab 6; SwitchToMode "normal"; } |
||||
bind "7" { GoToTab 7; SwitchToMode "normal"; } |
||||
bind "8" { GoToTab 8; SwitchToMode "normal"; } |
||||
bind "9" { GoToTab 9; SwitchToMode "normal"; } |
||||
} |
||||
} |
||||
|
||||
// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP |
||||
// eg. when terminal window with an active zellij session is closed |
||||
// Options: |
||||
// - detach (Default) |
||||
// - quit |
||||
// |
||||
// on_force_close "quit" |
||||
|
||||
// Send a request for a simplified ui (without arrow fonts) to plugins |
||||
// Options: |
||||
// - true |
||||
// - false (Default) |
||||
// |
||||
simplified_ui true |
||||
|
||||
// Choose the path to the default shell that zellij will use for opening new panes |
||||
// Default: $SHELL |
||||
// |
||||
// default_shell "fish" |
||||
|
||||
// Toggle between having pane frames around the panes |
||||
// Options: |
||||
// - true (default) |
||||
// - false |
||||
// |
||||
pane_frames false |
||||
|
||||
// Choose the theme that is specified in the themes section. |
||||
// Default: default |
||||
// |
||||
theme "tokyo-night" |
||||
|
||||
// The name of the default layout to load on startup |
||||
// Default: "default" |
||||
// |
||||
default_layout "compact" |
||||
|
||||
// Choose the mode that zellij uses when starting up. |
||||
// Default: normal |
||||
// |
||||
// default_mode "locked" |
||||
|
||||
// Toggle enabling the mouse mode. |
||||
// On certain configurations, or terminals this could |
||||
// potentially interfere with copying text. |
||||
// Options: |
||||
// - true (default) |
||||
// - false |
||||
// |
||||
mouse_mode true |
||||
|
||||
// Configure the scroll back buffer size |
||||
// This is the number of lines zellij stores for each pane in the scroll back |
||||
// buffer. Excess number of lines are discarded in a FIFO fashion. |
||||
// Valid values: positive integers |
||||
// Default value: 10000 |
||||
// |
||||
scroll_buffer_size 40000 |
||||
|
||||
// Provide a command to execute when copying text. The text will be piped to |
||||
// the stdin of the program to perform the copy. This can be used with |
||||
// terminal emulators which do not support the OSC 52 ANSI control sequence |
||||
// that will be used by default if this option is not set. |
||||
// Examples: |
||||
// |
||||
// copy_command "xclip -selection clipboard" // x11 |
||||
// copy_command "wl-copy" // wayland |
||||
// copy_command "pbcopy" // osx |
||||
|
||||
// Choose the destination for copied text |
||||
// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard. |
||||
// Does not apply when using copy_command. |
||||
// Options: |
||||
// - system (default) |
||||
// - primary |
||||
// |
||||
// copy_clipboard "primary" |
||||
|
||||
// Enable or disable automatic copy (and clear) of selection when releasing mouse |
||||
// Default: true |
||||
// |
||||
// copy_on_select false |
||||
|
||||
// Path to the default editor to use to edit pane scrollbuffer |
||||
// Default: $EDITOR or $VISUAL |
||||
// |
||||
// scrollback_editor "/usr/bin/vim" |
||||
|
||||
// When attaching to an existing session with other users, |
||||
// should the session be mirrored (true) |
||||
// or should each user have their own cursor (false) |
||||
// Default: false |
||||
// |
||||
// mirror_session true |
||||
|
||||
// The folder in which Zellij will look for layouts |
||||
// |
||||
// layout_dir /path/to/my/layout_dir |
||||
|
||||
// The folder in which Zellij will look for themes |
||||
// |
||||
// theme_dir "/path/to/my/theme_dir" |
||||
themes { |
||||
nord { |
||||
fg 216 222 233 |
||||
bg 46 52 64 |
||||
black 59 66 82 |
||||
red 191 97 106 |
||||
green 163 190 140 |
||||
yellow 235 203 139 |
||||
blue 129 161 193 |
||||
magenta 180 142 173 |
||||
cyan 136 192 208 |
||||
white 229 233 240 |
||||
orange 208 135 112 |
||||
} |
||||
tokyo-night { |
||||
fg 169 177 214 |
||||
bg 26 27 38 |
||||
black 56 62 90 |
||||
red 249 51 87 |
||||
green 158 206 106 |
||||
yellow 224 175 104 |
||||
blue 122 162 247 |
||||
magenta 187 154 247 |
||||
cyan 42 195 222 |
||||
white 192 202 245 |
||||
orange 255 158 100 |
||||
} |
||||
} |
Loading…
Reference in new issue