1
1
mirror of https://github.com/rywng/dotfiles.git synced 2024-11-24 20:01:49 +08:00

Compare commits

...

5 Commits

Author SHA1 Message Date
juan
90fb6ff11e added keybind to switch audio output 2021-08-25 19:56:23 +08:00
juan
4741dd5c05 Switch to zsh-z a faster z implementation in zsh 2021-08-23 16:57:24 +08:00
juan
8aa2e9ee9d Remove nvim since I have NvChap now
might add back as git submodule soon
 Changes to be committed:
	deleted:    .config/nvim/conf.d/coc.vim
	deleted:    .config/nvim/init.vim
	deleted:    .config/nvim/lua/dap-custom.lua

 Untracked files not listed
2021-08-22 22:56:56 +08:00
juan
85e9d24c17 update kitty colour 2021-08-22 17:32:05 +08:00
juan
2a3fd1f244 update sway 2021-08-22 10:24:01 +08:00
9 changed files with 18 additions and 305 deletions

View File

@ -37,3 +37,10 @@ color14 #95c4ce
# white # white
color7 #c6c8d1 color7 #c6c8d1
color15 #d2d4de color15 #d2d4de
# tab bar
active_tab_foreground #161821
active_tab_background #84a0c6
inactive_tab_foreground #d2d4de
inactive_tab_background #353a50
tab_bar_background #0f1117

View File

@ -1135,6 +1135,7 @@ symbol_map U+23FB-U+23FE,U+2B58,U+E200-U+E2A9,U+E0A0-U+E0A3,U+E0B0-U+E0BF,U+E0C0
# map kitty_mod+8 eighth_window # map kitty_mod+8 eighth_window
# map kitty_mod+9 ninth_window # map kitty_mod+9 ninth_window
# map kitty_mod+0 tenth_window # map kitty_mod+0 tenth_window
#: }}} #: }}}
#: Tab management {{{ #: Tab management {{{

View File

@ -1,116 +0,0 @@
"settings suggested by coc.
set hidden " Text Edit suggestion by coc
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
set updatetime=300
" Don't pass messages to |ins-completion-menu|.
set shortmess+=c
" Map <tab> for trigger completion, completion confirm, snippet expand and jump
inoremap <silent><expr> <TAB>
\ pumvisible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ?
\ "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<tab>'
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
" Make <CR> notify coc.nvim to
" format on enter, <cr> could be remapped by other vim plugin
" (I disabled enter to confirm.)
inoremap <silent><expr> <cr> "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code.
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Remap <C-f> and <C-b> for scroll float windows/popups.
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
" Use CTRL-S for selections ranges.
" Requires 'textDocument/selectionRange' support of language server.
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)
" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocAction('format')
" Add `:Fold` command to fold current buffer.
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add `:OR` command for organize imports of the current buffer.
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
" Add (Neo)Vim's native statusline support.
" NOTE: Please see `:h coc-stats` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline.
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Mappings for CoCList
" Show all diagnostics.
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions.
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
" Show commands.
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document.
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols.
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
" open COc yank
nnoremap <silent> <space>y :<C-u>CocList -A --normal yank<cr>

View File

@ -1,137 +0,0 @@
call plug#begin('~/.config/nvim/plugged')
" looks
Plug 'vim-airline/vim-airline' " airline for vim
Plug 'ryanoasis/vim-devicons' " adds many icons
Plug 'airblade/vim-gitgutter' " git changes on left.
Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' } " colors
Plug 'mhinz/vim-startify' " start page
Plug 'tomasiser/vim-code-dark' " colorscheme
Plug 'cocopon/iceberg.vim'
" misc
Plug 'vimwiki/vimwiki' " for my note taking.
Plug 'gentoo/gentoo-syntax' " syntax for gentoo related files
" Coding
Plug 'neoclide/coc.nvim', {'branch': 'release'} " code completion
Plug 'chiel92/vim-autoformat' " used to remove trailing spaces.
Plug 'honza/vim-snippets' " snippet supprt.
Plug 'szw/vim-maximizer' " maximizing panel
Plug 'mfussenegger/nvim-dap' " Inspector for vim
Plug 'rcarriga/nvim-dap-ui' " UI for dap
" functions
Plug 'machakann/vim-sandwich' " surrounding
Plug 'preservim/nerdcommenter' " comment out things
Plug 'nvim-lua/popup.nvim' " dependency of teltscope
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim' " replacement of ctrlp
Plug 'tpope/vim-repeat' " repeat support for stuff
Plug 'tpope/vim-fugitive' " Git support.
Plug 'easymotion/vim-easymotion' " better motion!!
Plug 'godlygeek/tabular' " for OCD people.
Plug 'dhruvasagar/vim-table-mode' " Taking notes in vim
" trees and bars
Plug 'preservim/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'preservim/tagbar' " press <F8> to get a tagbar.
call plug#end()
colorscheme iceberg
set termguicolors
set relativenumber
set number
set shiftwidth=2
set mouse=a
set ignorecase smartcase
set noshowmode
set smartindent
set scrolloff=10
" plugin settings
source ~/.config/nvim/conf.d/*
let g:startify_custom_header = 'startify#pad(startify#fortune#boxed())'
let g:startify_lists = [
\ { 'type': 'dir', 'header': [' MRU @ '. getcwd()] },
\ { 'type': 'sessions', 'header': [' Sessions'] },
\ { 'type': 'bookmarks', 'header': [' Bookmarks'] },
\ { 'type': 'commands', 'header': [' Commands'] },
\ ]
let g:startify_commands = [
\ {'w': ['Open Vim Wiki', ':VimwikiIndex']},
\ ]
let g:startify_custom_indices = [
\ 'a', 'd', 'f', 'l', ';', 'g']
let g:startify_skiplist = [
\ '^/tmp',
\ escape(fnamemodify($HOME, ':p'), '\') .'Documents/Personal/Wiki',
\ escape(fnamemodify($HOME, ':p'), '\') .'Encrypted',
\ escape(fnamemodify($HOME, ':p'), '\') .'.config/yadm/repo.git',
\ ]
let g:Hexokinase_ftDisabled = ['css']
let g:vimwiki_list = [{'path': '~/Documents/Personal/Wiki/',
\ 'syntax': 'markdown', 'ext': '.md'}]
" only enable vimwiki in wiki folder
let g:vimwiki_global_ext = 0
lua require("dapui").setup()
" keybindings (except for coc)
" Telescope
" Find files using Telescope command-line sugar.
nnoremap <leader>tf <cmd>Telescope fd<cr>
nnoremap <leader>tg <cmd>Telescope live_grep<cr>
nnoremap <leader>tb <cmd>Telescope buffers<cr>
nnoremap <leader>th <cmd>Telescope help_tags<cr>
" nerdtree tagbar coc formatter.
nnoremap <F12> <cmd>lua require("dapui").toggle()<cr>
nnoremap <F2> <cmd>Format<CR>
nnoremap <F8> <cmd>TagbarToggle<CR>
nnoremap <C-n> <cmd>NERDTreeToggle<CR>
nnoremap <C-l> <cmd>NERDTreeFind<CR>
" easymotion
nmap <space>f <Plug>(easymotion-f)
nmap <space>F <Plug>(easymotion-F)
nmap <space>l <Plug>(easymotion-lineanywhere)
nmap <space>j <Plug>(easymotion-j)
nmap <space>k <Plug>(easymotion-k)
nmap <space>w <Plug>(easymotion-w)
nmap <space>W <Plug>(easymotion-W)
nmap <space>b <Plug>(easymotion-b)
nmap <space>b <Plug>(easymotion-B)
" fix intending.
vmap < <gv
vmap > >gv
" make Y behave like other Capitalized letters
nnoremap Y y$
" n/N also centered
nnoremap n nzzzv
nnoremap N Nzzzv
" undo to the last , . or !
inoremap , ,<c-g>u
inoremap . .<c-g>u
inoremap ! !<c-g>u
inoremap ? ?<c-g>u
" Shortcutting split navigation
map <A-h> <C-w>h
map <A-j> <C-w>j
map <A-k> <C-w>k
map <A-l> <C-w>l
map <A-H> <C-w>H
map <A-J> <C-w>J
map <A-K> <C-w>K
map <A-L> <C-w>L
map <A->> <C-w>>
map <A-<> <C-w><
" Tab shortcuts
nnoremap <A-p> :tabp<CR>
nnoremap <A-n> :tabn<CR>
" map Alt + q to exit terminal mode.
tnoremap <A-q> <C-\><C-n>

View File

@ -1,39 +0,0 @@
local dap = require('dap')
dap.adapters.lldb = {
type = 'executable',
command = '/usr/bin/lldb', -- adjust as needed
name = "lldb"
}
local dap = require('dap')
dap.configurations.cpp = {
{
name = "Launch",
type = "lldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
args = {},
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
--
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
--
-- Otherwise you might get the following error:
--
-- Error on launch: Failed to attach to the target process
--
-- But you should be aware of the implications:
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
runInTerminal = false,
},
}
-- If you want to use this for rust and c, add something like this:
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp

View File

@ -5,7 +5,7 @@ set $up k
set $right l set $right l
set $term kitty set $term kitty
set $menu wofi | xargs swaymsg exec -- set $menu wofi | xargs swaymsg exec --
output * bg $(find /home/juan/Pictures/Wallpapers/. -type f | shuf -n1) fill output * bg $(find ~/Pictures/Wallpapers/ -type f | shuf -n1) fill
###CUSTOMIZATION START### ###CUSTOMIZATION START###
@ -18,6 +18,7 @@ exec mpd
#my keybinds #my keybinds
bindsym $mod+Ctrl+o exec ~/.config/sway/scripts/outputs.sh
bindsym $mod+Ctrl+l exec ~/.config/sway/scripts/logout.sh bindsym $mod+Ctrl+l exec ~/.config/sway/scripts/logout.sh
bindsym $mod+Print exec grim ~/Pictures/Screenshots/$(date +'%H:%M_%y%m%d.png'); \ bindsym $mod+Print exec grim ~/Pictures/Screenshots/$(date +'%H:%M_%y%m%d.png'); \
exec notify-send -t 3000 'Screenshot saved.' exec notify-send -t 3000 'Screenshot saved.'

View File

@ -2,7 +2,7 @@
"layer": "top", // Waybar at top layer "layer": "top", // Waybar at top layer
"height": 24, // Waybar height (to be removed for auto height) "height": 24, // Waybar height (to be removed for auto height)
// Choose the order of the modules // Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "custom/media","sway/window"], "modules-left": ["sway/workspaces", "sway/window"],
"modules-center": [], "modules-center": [],
"modules-right": ["tray","mpd","custom/weather","network","battery","clock"], "modules-right": ["tray","mpd","custom/weather","network","battery","clock"],
"mpd": { "mpd": {

View File

@ -74,12 +74,3 @@ window#waybar {
border-radius: 2px 0px 0px 2px; border-radius: 2px 0px 0px 2px;
margin-left: 10px; margin-left: 10px;
} }
#mode {
background-color: #89b8c2;
padding: 0px 5px 0px 5px;
margin: 5px;
margin-left: 0px;
margin-right: 10px;
border-radius: 2px;
}

9
.zshrc
View File

@ -25,6 +25,8 @@ zinit light zsh-users/zsh-autosuggestions
zinit ice lucid wait zinit ice lucid wait
zinit light zdharma/fast-syntax-highlighting zinit light zdharma/fast-syntax-highlighting
zinit light zsh-users/zsh-history-substring-search zinit light zsh-users/zsh-history-substring-search
zinit ice lucid wait
zinit light agkozak/zsh-z
autoload -Uz _zinit autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit (( ${+_comps} )) && _comps[zinit]=_zinit
@ -62,8 +64,8 @@ autoload edit-command-line
zle -N edit-command-line zle -N edit-command-line
bindkey '' edit-command-line bindkey '' edit-command-line
export _Z_DATA="$HOME/.cache/z" export ZSHZ_CASE=smart
. $HOME/.cache/z.sh export ZSHZ_DATA="$HOME/.cache/z"
zz () { zz () {
cd `z -l $* | fzf | awk '{print $2}'` cd `z -l $* | fzf | awk '{print $2}'`
} }
@ -99,6 +101,9 @@ export GOPATH=$HOME/.cache/go
export LESSHISTFILE=/dev/null export LESSHISTFILE=/dev/null
export LYNX_CFG=$HOME/.config/lynx/lynxrc export LYNX_CFG=$HOME/.config/lynx/lynxrc
#settings for software
export FZF_DEFAULT_OPTS="--reverse --cycle --height=40% --border sharp --prompt=🔎"
#colored output #colored output
export LESS_TERMCAP_md=$'\e[01;35m' export LESS_TERMCAP_md=$'\e[01;35m'
export LESS_TERMCAP_me=$'\e[0m' export LESS_TERMCAP_me=$'\e[0m'