feat: updates

This commit is contained in:
Chen Asraf
2023-06-13 10:34:43 +03:00
parent 3d86e373cf
commit 9327637b47
10 changed files with 46 additions and 21 deletions

View File

@@ -26,7 +26,7 @@ hints:
- binding:
key: U
mods: Control|Shift
command: xdg-open
command: open
hyperlinks: true
mouse:
enabled: true

View File

@@ -21,6 +21,12 @@ local cmp_mappings = lsp.defaults.cmp_mappings({
["<C-Space>"] = cmp.mapping.complete(),
})
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
cmp_mappings['<Tab>'] = nil
cmp_mappings['<S-Tab>'] = nil

View File

@@ -1 +1,16 @@
require("oil").setup({})
require("oil").setup({
columns = {
"icon",
"size"
},
view_options = {
show_hidden = true,
---@diagnostic disable-next-line: unused-local
is_always_hidden = function(name, bufnr)
if name == '.git' then
return true
end
return false
end
},
})

View File

@@ -8,13 +8,17 @@ session_manager.setup({
local config_group = vim.api.nvim_create_augroup('casraf_session', {})
local function isnt_special(saving)
return vim.bo.filetype ~= 'git'
and vim.bo.filetype ~= 'gitcommit'
and vim.bo.filetype ~= 'gitrebase'
and (not saving or vim.fn.stridx(vim.fn.expand('%'), 'oil://') == -1)
end
vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
group = config_group,
callback = function()
if vim.bo.filetype ~= 'git'
and vim.bo.filetype ~= 'gitcommit'
and vim.bo.filetype ~= 'gitrebase'
then
if isnt_special(true) then
session_manager.autosave_session()
end
end
@@ -23,10 +27,7 @@ vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
vim.api.nvim_create_autocmd({ 'VimEnter' }, {
group = config_group,
callback = function()
if vim.bo.filetype ~= 'git'
and vim.bo.filetype ~= 'gitcommit'
and vim.bo.filetype ~= 'gitrebase'
then
if isnt_special(false) then
session_manager.load_current_dir_session()
end
end

View File

@@ -21,5 +21,9 @@ require('nvim-treesitter.configs').setup({
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
autotag = {
enable = true,
},
})

View File

@@ -138,4 +138,11 @@ return require('packer').startup(function(use)
use({ 'kylechui/nvim-surround', branch = "main" })
require('nvim-surround').setup({})
use('windwp/nvim-autopairs')
require('nvim-autopairs').setup({
enable_check_bracket_line = false
})
use('windwp/nvim-ts-autotag')
end)

5
.zshrc
View File

@@ -37,8 +37,3 @@ source $DOTFILES/scripts/home/home.sh
# echo 'Loading '$DOTFILES/zsh_init.sh
source $DOTFILES/zsh_init.sh
# source all files in scripts dir
for file in $DOTFILES/scripts/*; do
[[ -f "$file" ]] && source $file
done

View File

@@ -106,7 +106,7 @@ alias tn-df="tn-custom -d \$DOTFILES -s dotfiles ."
alias tn-tt="tn-custom -d \$HOME/.local/share/nvim/site/pack/packer/start/text-transform.nvim -s text-transform ."
alias tn-simple-scaffold="tn-prj simple-scaffold"
alias tn-dungeon-paper="tn-prj dungeon_paper"
alias tn-acroasis="tn-custom -d \$HOME/Dev/acroasis -s acroasis front server shared landing"
alias tn-acroasis="tn-custom -d \$HOME/Dev/acroasis -s acroasis . front server shared landing"
if is_linux; then
alias md5="md5sum"

View File

@@ -159,9 +159,6 @@ rand() {
echo $(($RANDOM % ($max - $min + 1) + $min))
}
# need to source because VS Code raises error on the function
source $DOTFILES/scripts/randarg.sh
# select random element from list
randline() {
if [[ $# -eq 0 ]]; then
@@ -335,13 +332,14 @@ tn-custom () {
done
tmux has-session -t $winname 2>/dev/null
if [[ "$?" == "0" ]]; then
echo_cyan "Attaching to existing session $winname"
tmux attach-session -t $winname
return 0
fi
dirs=("$@")
echo "Creating new session $winname on $parent with dirs: $dirs"
echo_cyan "Creating new session $winname on $parent with dirs: $dirs"
tmux -f ~/.config/.tmux.conf new-session -d -s $winname -n general -c $parent
for dir in ${dirs[@]}; do

View File

@@ -1 +0,0 @@