Skip to content

Commit

Permalink
Adding tlrc,fzf and more
Browse files Browse the repository at this point in the history
  • Loading branch information
daonb committed Jun 17, 2024
1 parent 8609e87 commit df3c53e
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 18 deletions.
43 changes: 42 additions & 1 deletion .config/nvim/after/plugin/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,46 @@ require 'nvim-treesitter.configs'.setup {
enable = true,
additional_vim_regex_highlighting = false,
},
}
textobjects = {
select = {
enable = true,

-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,

keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
-- You can optionally set descriptions to the mappings (used in the desc parameter of
-- nvim_buf_set_keymap) which plugins like which-key display
["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" },
-- You can also use captures from other query groups like `locals.scm`
["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" },
},
-- You can choose the select mode (default is charwise 'v')
--
-- Can also be a function which gets passed a table with the keys
-- * query_string: eg '@function.inner'
-- * method: eg 'v' or 'o'
-- and should return the mode ('v', 'V', or '<c-v>') or a table
-- mapping query_strings to modes.
selection_modes = {
['@parameter.outer'] = 'v', -- charwise
['@function.outer'] = 'V', -- linewise
['@class.outer'] = '<c-v>', -- blockwise
},
-- If you set this to `true` (default is `false`) then any textobject is
-- extended to include preceding or succeeding whitespace. Succeeding
-- whitespace has priority in order to act similarly to eg the built-in
-- `ap`.
--
-- Can also be a function which gets passed a table with the keys
-- * query_string: eg '@function.inner'
-- * selection_mode: eg 'v'
-- and should return true or false
include_surrounding_whitespace = true,
},
},
}
18 changes: 18 additions & 0 deletions .config/nvim/lua/daonb/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,22 @@ require('lualine').setup {
inactive_winbar = {},
extensions = {}
}
vim.g.clipboard = {
name = 'webexec',
copy = {
["+"] = {'webexec', 'copy'},
["*"] = {'webexec', 'copy'},
},
paste = {
["+"] = {'webexec', 'paste'},
["*"] = {'webexec', 'paste'},
},
cache_enabled = true,
}
vim.cmd [[
hi diffText ctermfg=188 ctermbg=64 cterm=bold guifg=#FFFFFF guibg=#303030 gui=bold
hi diffAdded ctermfg=188 ctermbg=64 cterm=bold guifg=#50FA7B guibg=#303030 gui=bold
hi diffChange ctermfg=188 ctermbg=NONE cterm=bold guifg=#50FA7B guibg=#303030 gui=bold
hi diffRemoved ctermfg=88 ctermbg=NONE cterm=NONE guifg=#FA5057 guibg=#303030 gui=NONE
]]

7 changes: 6 additions & 1 deletion .config/nvim/lua/daonb/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,10 @@ return require('packer').startup(function(use)
use 'mfussenegger/nvim-dap-python'
use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"} }
use {'github/copilot.vim', branch = 'release' }

use({
"nvim-treesitter/nvim-treesitter-textobjects",
after = "nvim-treesitter",
requires = "nvim-treesitter/nvim-treesitter",
})
use 'nvim-treesitter/nvim-treesitter-context'
end)
23 changes: 23 additions & 0 deletions .config/nvim/lua/daonb/remap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,26 @@ vim.keymap.set('n', '<C-t>', function() ui.nav_file(2) end)
vim.keymap.set('n', '<C-n>', function() ui.nav_file(3) end)
vim.keymap.set('n', '<C-s>', function() ui.nav_file(4) end)
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})

vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
vim.keymap.set('n', '<F10>', function() require('dap').step_over() end)
vim.keymap.set('n', '<F11>', function() require('dap').step_into() end)
vim.keymap.set('n', '<F12>', function() require('dap').step_out() end)
vim.keymap.set('n', '<Leader>b', function() require('dap').toggle_breakpoint() end)
vim.keymap.set('n', '<Leader>B', function() require('dap').set_breakpoint() end)
vim.keymap.set('n', '<Leader>dr', function() require('dap').repl.open() end)
vim.keymap.set('n', '<Leader>dl', function() require('dap').run_last() end)
vim.keymap.set({'n', 'v'}, '<Leader>dh', function()
require('dap.ui.widgets').hover()
end)
vim.keymap.set({'n', 'v'}, '<Leader>dp', function()
require('dap.ui.widgets').preview()
end)
vim.keymap.set('n', '<Leader>df', function()
local widgets = require('dap.ui.widgets')
widgets.centered_float(widgets.frames)
end)
vim.keymap.set('n', '<Leader>ds', function()
local widgets = require('dap.ui.widgets')
widgets.centered_float(widgets.scopes)
end)
2 changes: 2 additions & 0 deletions .config/starship.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[gcloud]
disabled = true
6 changes: 3 additions & 3 deletions .config/yadm/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ else
curl https://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x64.tar.xz | tar x
mv node-v12.16.1-linux-x64 /usr/local/bin/node
sudo snap install lsd
nix-shell -p tlrc
fi
# antigen, the zsh pluging manager
mkdir -p $HOME/.zsh
curl -L git.io/antigen > $HOME/.zsh/antigen.zsh
# zinit, zsh plugin manager
sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
# pure prompt
git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure"
# go
Expand Down
25 changes: 12 additions & 13 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
export EDITOR='nvim'
export VISUAL=$EDITOR
export KEYTIMEOUT=1
export HISTFILE=~/.zsh_history
export HISTSIZE=50000
export SAVEHIST=50000
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export GO11MODULE=on
export PATH="$HOME/.local/bin:$HOME/go/bin:$HOME/node/bin:/usr/local/go/bin:/snap/bin:/sbin:$PATH"
export CHAMBER_KMS_KEY_ALIAS=aws/ssm
export PATH="$HOME/.local/bin:$HOME/go/bin:$HOME/node/bin:/usr/local/go/bin:/Library/TeX/texbin:/snap/bin:/sbin:$PATH"

if [ -d "/usr/games" ]; then
export PATH="/usr/games:$PATH"
Expand All @@ -28,10 +24,13 @@ eval "$(direnv hook zsh)"
bindkey -v
bindkey -M vicmd '?' history-incremental-search-backward
# History
setopt extendedhistory
# setopt appendhistory
setopt appendhistory
setopt sharehistory
setopt histexpiredupsfirst
setopt hist_ignore_all_dups
setopt hist_ignore_space
setopt hist_ignore_dups
setopt hist_save_no_dups

unsetopt PROMPT_CR
# bindkey '^[[A' up-line-or-search
# bindkey '^[[B' down-line-or-search
Expand All @@ -45,12 +44,9 @@ alias lg="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%
alias gdb="arch -arm64 dlv debug"
alias got="go test -v -race -coverprofile=coverage.txt -covermode=atomic"
alias imgcat="python3 -m imgcat"
# django (python framework) related aliases
alias m="poetry run python manage.py"
alias r="poetry run python manage.py runserver --settings elucd_vault.dev_settings"

alias gts="git status"
alias gtc="git checkout"
eval "$(starship init zsh)"

# Set the color palette
function set_color {
eval "$1=$2"
Expand All @@ -71,6 +67,8 @@ set_color username_color $yellow
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# Set up fzf key bindings and fuzzy completion
eval "$(fzf --zsh)"

# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/daonb/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/daonb/google-cloud-sdk/path.zsh.inc'; fi
Expand Down Expand Up @@ -99,6 +97,7 @@ fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
### End of Zinit's installer chunk
# loading zsh plugins
zinit light-mode for \
djui/alias-tips \
Expand Down
4 changes: 4 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ brew 'direnv'
brew 'lsd'
brew 'ripgrep'
brew 'stylua'
brew 'tlrc'
brew 'bat'
brew 'fd'
brew 'fzf'

0 comments on commit df3c53e

Please sign in to comment.