diff --git a/.shellcheckrc b/.shellcheckrc index 6924f90..f7fa11e 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -2,3 +2,5 @@ disable=SC1090 disable=SC1091 disable=SC2155 disable=SC2223 +disable=SC2015 +disable=SC2059 diff --git a/bash/.bash/util/terminal.sh b/bash/.bash/util/terminal.sh index e9f31f3..aef8d44 100644 --- a/bash/.bash/util/terminal.sh +++ b/bash/.bash/util/terminal.sh @@ -12,7 +12,7 @@ declare -i verbose=0 declare -i force=0 askForConfirmation() { - [ $force != 0 ] && return 0 + [ "$force" != 0 ] && return 0 printQuestion "$1 [Y/n] " read -r response case $response in @@ -47,7 +47,7 @@ printResult() { } print() { - [ $silent = 0 ] && printf "$1" + [ "$silent" = 0 ] && printf "$1" } println() { @@ -55,7 +55,7 @@ println() { } printColor() { - if [ $nocolor = 0 ]; then + if [ "$nocolor" = 0 ]; then print "$1$2${COLOR_RESET}" else print "$2" @@ -87,5 +87,5 @@ printInfo() { } printDebug() { - [ $verbose = 1 ] && println " $1" + [ "$verbose" = 1 ] && println " $1" } diff --git a/check.sh b/check.sh index c11d207..36a2487 100755 --- a/check.sh +++ b/check.sh @@ -13,6 +13,7 @@ expectCommand() { checkBashScripts() { expectCommand shellcheck local -r files="$(find . -type f -name "*.sh" \ + -not -path "./.install/*" \ -not -path "*/deps/*" \ -not -path "*/plugins/*" \ -not -path "*/tmp/*" \ @@ -27,6 +28,7 @@ checkLuaScripts() { expectCommand luacheck echo -e "\n>>> Running Luacheck" local -r files="$(find . -type f -name "*.lua" \ + -not -path "./.install/*" \ -not -path "*/deps/*" \ -not -path "*/.luarocks/*" \ -not -path "*/tmp/*")" diff --git a/nvim/.nvim/lua/plugin/telescope.lua b/nvim/.nvim/lua/plugin/telescope.lua index 9b1f318..cfad4f8 100644 --- a/nvim/.nvim/lua/plugin/telescope.lua +++ b/nvim/.nvim/lua/plugin/telescope.lua @@ -47,12 +47,14 @@ function _M.keymap() map( "n", "gh", - ":lua require('gitsigns').setqflist(0, { open = false }); require('telescope.builtin').quickfix({ prompt_title='Git hunks' })" + ":lua require('gitsigns').setqflist(0, { open = false });" + .. "require('telescope.builtin').quickfix({ prompt_title='Git hunks' })" ) map( "n", "ga", - ":lua require('gitsigns').setqflist('all', { open = false }); require('telescope.builtin').quickfix({ prompt_title='Git workspace hunks' })" + ":lua require('gitsigns').setqflist('all', { open = false });" + .. "require('telescope.builtin').quickfix({ prompt_title='Git workspace hunks' })" ) end diff --git a/nvim/.nvim/lua/plugin/tokyonight.lua b/nvim/.nvim/lua/plugin/tokyonight.lua index 7173b33..512f7a0 100644 --- a/nvim/.nvim/lua/plugin/tokyonight.lua +++ b/nvim/.nvim/lua/plugin/tokyonight.lua @@ -1,54 +1,54 @@ -local dcolors = require("tokyonight.colors").default +-- local dcolors = require("tokyonight.colors").default require("tokyonight").setup({ - on_highlights = function(hl, c) - -- local bg = c.bg - -- local prompt_bg = "#2d3149" - -- local preview_bg = dcolors.bg - -- Telescope - borderless - -- hl.TelescopeNormal = { - -- bg = bg, - -- fg = c.fg_dark, - -- } - -- hl.TelescopeBorder = { - -- bg = bg, - -- fg = bg, - -- } - -- -- Prompt (text field) - -- hl.TelescopePromptNormal = { - -- bg = prompt_bg, - -- } - -- hl.TelescopePromptBorder = { - -- bg = prompt_bg, - -- fg = prompt_bg, - -- } - -- hl.TelescopePromptTitle = { - -- bg = prompt_bg, - -- fg = c.comment, - -- } - -- -- Results (left column) - -- hl.TelescopeResultsTitle = { - -- bg = bg, - -- fg = bg, - -- } - -- -- Preview (right column) - -- hl.TelescopePreviewNormal = { - -- bg = preview_bg, - -- } - -- hl.TelescopePreviewBorder = { - -- bg = preview_bg, - -- fg = preview_bg, - -- } - -- hl.TelescopePreviewTitle = { - -- fg = c.comment, - -- } - -- Selection - -- hl.TelescopeSelection = { fg = c.magenta_dark, bg = bg_dark } - -- hl.TelescopeSelectionCaret = { fg = c.magenta } - -- Floats (borderless terminal - WIP) - -- hl.Normal = { bg = c.magenta, fg = c.blue } - -- hl.FloatBorder = { bg = preview_bg } - end, + -- on_highlights = function(hl, c) + -- local bg = c.bg + -- local prompt_bg = "#2d3149" + -- local preview_bg = dcolors.bg + -- Telescope - borderless + -- hl.TelescopeNormal = { + -- bg = bg, + -- fg = c.fg_dark, + -- } + -- hl.TelescopeBorder = { + -- bg = bg, + -- fg = bg, + -- } + -- -- Prompt (text field) + -- hl.TelescopePromptNormal = { + -- bg = prompt_bg, + -- } + -- hl.TelescopePromptBorder = { + -- bg = prompt_bg, + -- fg = prompt_bg, + -- } + -- hl.TelescopePromptTitle = { + -- bg = prompt_bg, + -- fg = c.comment, + -- } + -- -- Results (left column) + -- hl.TelescopeResultsTitle = { + -- bg = bg, + -- fg = bg, + -- } + -- -- Preview (right column) + -- hl.TelescopePreviewNormal = { + -- bg = preview_bg, + -- } + -- hl.TelescopePreviewBorder = { + -- bg = preview_bg, + -- fg = preview_bg, + -- } + -- hl.TelescopePreviewTitle = { + -- fg = c.comment, + -- } + -- Selection + -- hl.TelescopeSelection = { fg = c.magenta_dark, bg = bg_dark } + -- hl.TelescopeSelectionCaret = { fg = c.magenta } + -- Floats (borderless terminal - WIP) + -- hl.Normal = { bg = c.magenta, fg = c.blue } + -- hl.FloatBorder = { bg = preview_bg } + -- end, }) -- vim.cmd("colorscheme tokyonight") diff --git a/nvim/.nvim/lua/settings.lua b/nvim/.nvim/lua/settings.lua index 41987dc..b7ee90a 100644 --- a/nvim/.nvim/lua/settings.lua +++ b/nvim/.nvim/lua/settings.lua @@ -81,16 +81,18 @@ opt.expandtab = true -- use spaces for tabs opt.shiftwidth = 4 opt.softtabstop = 4 -- number of spaces in tab when editing opt.tabstop = 4 -- number of visual spaces per TAB + -- Wrapping options opt.wrap = false -opt.formatoptions = opt.formatoptions + "tc" -- wrap text and comments using textwidth -opt.formatoptions = opt.formatoptions + "r" -- continue comments when pressing ENTER in I mode -opt.formatoptions = opt.formatoptions + "q" -- enable formatting of comments with gq -opt.formatoptions = opt.formatoptions + "n" -- detect lists for formatting -opt.formatoptions = opt.formatoptions + "b" -- auto-wrap in insert mode, and do not wrap old long lines +opt.formatoptions = opt.formatoptions + "tc" -- wrap text and comments using textwidth +opt.formatoptions = opt.formatoptions + "r" -- continue comments when pressing ENTER in I mode +opt.formatoptions = opt.formatoptions + "q" -- enable formatting of comments with gq +opt.formatoptions = opt.formatoptions + "n" -- detect lists for formatting +opt.formatoptions = opt.formatoptions + "b" -- auto-wrap in insert mode, and do not wrap old long lines + -- Whitespace characters -opt.list = true -- by default present whitecharacters -opt.listchars = "space:·,eol:¬,tab:▸ ,nbsp:_,trail:·,extends:»,precedes:«" -- secure mapping for white characters +opt.list = true -- present whitecharacters +opt.listchars = "space:·,eol:¬,tab:▸ ,nbsp:_,trail:·,extends:»,precedes:«" -- white characters -- Spellcheck ----------------------------------------------------------- diff --git a/nvim/shared.sh b/nvim/shared.sh index f6169ed..002ab6c 100755 --- a/nvim/shared.sh +++ b/nvim/shared.sh @@ -8,9 +8,11 @@ installNvimDependencies() { printInfo "Installing nvim dependencies" for file in $(find "$SDIR/deps" -mindepth 1 -maxdepth 1 -type f | sort | sed -n "s|^.*/||p"); do printInfo "Installing nvim dependency: $file" - "$SDIR/deps/$file" && - printSuccess "Installed nvim dependency: $file" || + if "$SDIR/deps/$file"; then + printSuccess "Installed nvim dependency: $file" + else printError "Could not install nvim dependency: $file" + fi done printInfo "To reinstall nvim dependencies run: nvim-install-deps" printInfo "...or reinstall single nvim dependency with: nvim-install-dep NAME" diff --git a/zsh/update.sh b/zsh/update.sh index 4bc7c96..ef27d8f 100755 --- a/zsh/update.sh +++ b/zsh/update.sh @@ -9,6 +9,7 @@ updatePlugins() { local -r dotfileDirs="$(find "$HOME/.zsh/deps" -mindepth 1 -maxdepth 1 -type d | sort)" for dir in $dotfileDirs; do if [ -d "$dir/.git" ]; then + # shellcheck disable=SC1083 (cd "$dir" && git fetch --all && git reset --hard @{u}) fi done