diff --git a/common/.zshrc b/common/.zshrc index 93a0a2e..08923df 100644 --- a/common/.zshrc +++ b/common/.zshrc @@ -9,22 +9,14 @@ if [[ -f "$HOME/.zshcfg" ]]; then else CONF_BINARYCLOCK=0 CONF_ENABLEGIT=0 - CONF_ENABLEAC=0 CONF_FORTUNE=0 fi if [[ $CONF_ENABLEGIT -eq 1 ]]; then if [[ ! -d "$HOME/.zsh/gitstatus" ]]; then - git clone --depth=1 https://github.com/romkatv/gitstatus.git "$HOME/.zsh/gitstatus" + git clone --depth=1 https://github.com/romkatv/gitstatus.git ~/.zsh/gitstatus fi - source "$HOME/.zsh/gitstatus/gitstatus.plugin.zsh" -fi - -if [[ $CONF_ENABLEAC -eq 1 ]]; then - if [[ ! -d "$HOME/.zsh/zsh-autosuggestions" ]]; then - git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions.git "$HOME/.zsh/zsh-autosuggestions" - fi - source "$HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh" + source ~/.zsh/gitstatus/gitstatus.plugin.zsh fi # Lines configured by zsh-newuser-install @@ -167,8 +159,6 @@ bindkey '^[[5~' history-search-backward # pgup prev in history no bindkey '^[[6~' history-search-forward # pgdn next in history no search bindkey '^F' expand-or-complete # ctrl+f tab -[[ $CONF_ENABLEAC -eq 1 ]] && bindkey '^G' autosuggest-accept - bindkey -r '^I' #### @@ -241,4 +231,4 @@ fi if [[ $CONF_FORTUNE -eq 1 ]]; then fortune $CONF_FORTUNE_PATH echo -fi +fi \ No newline at end of file diff --git a/common/nvim/after/plugin/barbar.lua b/common/nvim/after/plugin/barbar.lua index 4670e72..e471134 100644 --- a/common/nvim/after/plugin/barbar.lua +++ b/common/nvim/after/plugin/barbar.lua @@ -49,8 +49,6 @@ barbar.setup({ }, sidebar_filetypes = { NvimTree = true, - undotree = true, - packer = true, - tsplayground = true, + undotree = {text = "undotree"}, }, }) diff --git a/common/nvim/after/plugin/colors.lua b/common/nvim/after/plugin/colors.lua index 611ae6e..5058549 100644 --- a/common/nvim/after/plugin/colors.lua +++ b/common/nvim/after/plugin/colors.lua @@ -1,97 +1,4 @@ -vim.o.termguicolors = 1 -vim.g.mode = "focus" -vim.cmd("colorscheme amora") - -local function c(name) - return vim.g["amora#palette"][name] -end - -local function h(scope, fg, bg, attr_list, special) - bg = bg or {"NONE", "NONE"} - attr_list = attr_list or {"NONE"} - local attrs = table.concat(attr_list, ",") - special = special or fg and fg or {"NONE", "NONE"} - - local cmd = "highlight %s " - if fg then - cmd = cmd .. "guifg=%s ctermfg=%s " - end - cmd = cmd .. "guibg=%s ctermbg=%s " - cmd = cmd .. "gui=%s cterm=%s " - cmd = cmd .. "guisp=%s" - - if fg then - cmd = cmd:format(scope, fg[1], fg[2], bg[1], bg[2], attrs, attrs, special[1]) - else - cmd = cmd:format(scope, bg[1], bg[2], attrs, attrs, special[1]) - end - - vim.cmd(cmd) -end - -vim.cmd("hi! link IndentBlanklineIndent1 AmoraYellow") -vim.cmd("hi! link IndentBlanklineIndent2 AmoraGreen") -vim.cmd("hi! link IndentBlanklineIndent3 AmoraPink") -vim.cmd("hi! link IndentBlanklineIndent4 AmoraPurple") - -vim.cmd("hi! link IndentBlanklineChar NonText") -vim.cmd("hi! link IndentBlanklineSpaceChar NonText") -vim.cmd("hi! link IndentBlanklineSpaceCharBlankline NonText") -vim.cmd("hi! clear IndentBlanklineContextStart") -h("IndentBlanklineContextChar", c("selection")) - -vim.cmd("hi! link SignColumn LineNr") - -vim.cmd("hi! link Hlargs AmoraYellowItalic") -vim.cmd("hi! link Function AmoraCyan") -vim.cmd("hi! link Statement AmoraRed") -vim.cmd("hi! link Conditional AmoraRed") -vim.cmd("hi! link Repeat AmoraRed") -vim.cmd("hi! link Label AmoraRed") -vim.cmd("hi! link Keyword AmoraRed") -vim.cmd("hi! link Exception AmoraRed") -vim.cmd("hi! link Operator AmoraRed") -vim.cmd("hi! link javaScriptRegexpString AmoraYellow") - -vim.cmd("hi! link CmpItemKindDefault AmoraPink") -vim.cmd("hi! link LspDiagnosticsDefaultWarning AmoraYellow") -vim.cmd("hi! link DiagnosticHint AmoraCyan") -vim.cmd("hi! link DiagnosticError AmoraRed") -vim.cmd("hi! link DiagnosticWarn AmoraYellow") -vim.cmd("hi! link DiagnosticInfo AmoraFg") - -h("Normal", c("fg"), c("bg")) -h("NonText", c("bglighter")) -h("IncSearch", c("bg"), c("yellow")) -h("WarningMsg", c("bg"), c("yellow")) -h("ErrorMsg", c("fg"), c("red")) -h("ExtraWhitespace", nil, c("red")) -h("ColorColumn", c("yellow"), c("bglighter")) -h("MatchParen", c("selection"), nil, {"underline"}) - -h("BufferCurrent", c("pink")) -h("BufferCurrentIndex", c("pink")) -h("BufferCurrentMod", c("yellow")) -h("BufferCurrentSign", c("pink")) -h("BufferCurrentTarget", c("pink")) -h("BufferVisible", c("fg")) -h("BufferVisibleIndex", c("fg")) -h("BufferVisibleMod", c("selection")) -h("BufferVisibleSign", c("fg")) -h("BufferVisibleTarget", c("fg")) -h("BufferInactive", c("comment"), c("bgdark")) -h("BufferInactiveIndex", c("pink"), c("bgdark")) -h("BufferInactiveMod", c("comment"), c("bgdark")) -h("BufferInactiveSign", c("comment"), c("bgdark")) -h("BufferInactiveTarget", c("green"), c("bgdark")) -h("BufferTabpages", c("fg"), c("bgdark")) -h("BufferTabpageFill", c("fg"), c("bgdark")) -h("BufferOffset", c("bg"), c("bg")) - -h("WilderAccent", c("pink")) -h("WilderSelectedAccent", c("fg"), c("selection")) - ---[[vim.cmd("colorscheme lena") +vim.cmd("colorscheme lena") vim.cmd("highlight IndentBlanklineIndent1 ctermfg=11 cterm=nocombine") vim.cmd("highlight IndentBlanklineIndent2 ctermfg=10 cterm=nocombine") @@ -132,4 +39,4 @@ vim.cmd("hi! link SignColumn LineNr") vim.cmd("hi DiagnosticHint ctermfg=6") vim.cmd("hi DiagnosticError ctermfg=1") vim.cmd("hi DiagnosticWarn ctermfg=3") -vim.cmd("hi DiagnosticInfo ctermfg=7")--]] +vim.cmd("hi DiagnosticInfo ctermfg=7") diff --git a/common/nvim/after/plugin/fugitive.lua b/common/nvim/after/plugin/fugitive.lua new file mode 100644 index 0000000..80c9070 --- /dev/null +++ b/common/nvim/after/plugin/fugitive.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "gs", vim.cmd.Git) diff --git a/common/nvim/after/plugin/lsp.lua b/common/nvim/after/plugin/lsp.lua index 411352e..22a89e1 100644 --- a/common/nvim/after/plugin/lsp.lua +++ b/common/nvim/after/plugin/lsp.lua @@ -56,7 +56,3 @@ lsp.setup() vim.diagnostic.config({ virtual_text = true }) - -require("lsp_signature").setup({ - hint_prefix = "▲ ", -}) diff --git a/common/nvim/after/plugin/lualine.lua b/common/nvim/after/plugin/lualine.lua index 0070dbb..edc7dbb 100644 --- a/common/nvim/after/plugin/lualine.lua +++ b/common/nvim/after/plugin/lualine.lua @@ -1,4 +1,4 @@ ---[[local theme = require("lualine.themes.16color") +local theme = require("lualine.themes.16color") theme.normal.a.bg = 7 theme.visual.a.bg = 4 theme.command = { @@ -7,72 +7,8 @@ theme.command = { theme.terminal = { a = {bg = 5}, } -theme.normal.c.bg = "none"--]] +theme.normal.c.bg = "none" -local function c(name) - return vim.g["amora#palette"][name][1] -end - -local theme = { - normal = { - a = { - fg = c("bg"), - bg = c("fg"), - }, - b = { - fg = c("fg"), - bg = c("bglighter"), - }, - c = { - fg = c("fg"), - bg = c("bg"), - }, - }, - insert = { - a = { - fg = c("bg"), - bg = c("green"), - }, - }, - visual = { - a = { - fg = c("bg"), - bg = c("purple"), - }, - }, - replace = { - a = { - fg = c("bg"), - bg = c("red"), - }, - }, - command = { - a = { - fg = c("bg"), - bg = c("cyan"), - }, - }, - terminal = { - a = { - fg = c("bg"), - bg = c("pink"), - }, - }, - inactive = { - a = { - fg = c("fg"), - bg = c("bgdarker"), - }, - b = { - fg = c("fg"), - bg = c("bgdarker"), - }, - c = { - fg = c("fg"), - bg = c("bgdarker"), - }, - }, -} require("lualine").setup({ options = { icons_enabled = false, @@ -80,13 +16,16 @@ require("lualine").setup({ section_separators = "", component_separators = "", disabled_filetypes = { - statusline = {"NvimTree", "undotree", "diff", "tsplayground", "packer"}, + statusline = {"NvimTree", "undotree", "diff"}, }, }, sections = { lualine_a = { { "mode", + color = { + fg = 0, + }, fmt = function(str) return str:sub(1,3) end @@ -96,47 +35,26 @@ require("lualine").setup({ { "branch", color = { - bg = c("pink"), - fg = c("bgdarker"), + bg = 5, + fg = 0, }, }, { "diff", diff_color = { - added = { - bg = c("bgdark"), - fg = c("green"), - }, - modified = { - bg = c("bgdark"), - fg = c("yellow"), - }, - removed = { - bg = c("bgdark"), - fg = c("red"), - }, + added = {bg = 8, fg = 2}, + modified = {bg = 8, fg = 3}, + removed = {bg = 8, fg = 1}, }, }, { "diagnostics", sections = {"error", "warn", "info", "hint"}, diagnostics_color = { - error = { - bg = c("bgdark"), - fg = c("red"), - }, - warn = { - bg = c("bgdark"), - fg = c("yellow"), - }, - info = { - bg = c("bgdark"), - fg = c("fg"), - }, - hint = { - bg = c("bgdark"), - fg = c("cyan"), - }, + error = {bg = 0, fg = 1}, + warn = {bg = 0, fg = 3}, + info = {bg = 0, fg = 7}, + hint = {bg = 0, fg = 6}, }, }, }, @@ -144,8 +62,8 @@ require("lualine").setup({ { "filename", color = { - bg = c("bg"), - fg = c("pink"), + bg = "none", + fg = 5, }, }, }, @@ -153,8 +71,8 @@ require("lualine").setup({ { "location", color = { - bg = c("purple"), - fg = c("bg"), + bg = 4, + fg = 0, }, }, }, @@ -162,19 +80,19 @@ require("lualine").setup({ { "encoding", color = { - bg = c("yellow"), - fg = c("bg"), - }, - padding = { - left = 1, - right = 0, + bg = 3, + fg = 0, }, }, { "fileformat", color = { - bg = c("yellow"), - fg = c("bg"), + bg = 3, + fg = 0, + }, + padding = { + left = 0, + right = 1, }, }, }, @@ -182,8 +100,8 @@ require("lualine").setup({ { "filetype", color = { - bg = c("fg"), - fg = c("bg"), + bg = 7, + fg = 0, }, }, }, diff --git a/common/nvim/after/plugin/presence.lua b/common/nvim/after/plugin/presence.lua new file mode 100644 index 0000000..2e28cbd --- /dev/null +++ b/common/nvim/after/plugin/presence.lua @@ -0,0 +1 @@ +vim.g.presence_buttons = false diff --git a/common/nvim/after/plugin/prettier.lua b/common/nvim/after/plugin/prettier.lua index 44c6db3..d7d0925 100644 --- a/common/nvim/after/plugin/prettier.lua +++ b/common/nvim/after/plugin/prettier.lua @@ -36,10 +36,16 @@ prettier.setup({ bin = "prettier", filetypes = { "css", + "graphql", + "html", "javascript", "javascriptreact", + "json", + "less", + "markdown", "scss", "typescript", "typescriptreact", + "yaml", }, }) diff --git a/common/nvim/after/plugin/telescope.lua b/common/nvim/after/plugin/telescope.lua index c09aed9..f029a05 100644 --- a/common/nvim/after/plugin/telescope.lua +++ b/common/nvim/after/plugin/telescope.lua @@ -5,7 +5,7 @@ telescope.setup({ } }) -local builtin = require("telescope.builtin") -vim.keymap.set("n", "ff", builtin.find_files) -vim.keymap.set("n", "fg", builtin.git_files) -vim.keymap.set("n", "fs", builtin.live_grep) +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'pf', builtin.find_files, {}) +vim.keymap.set('n', '', builtin.git_files, {}) +vim.keymap.set('n', 'ps', builtin.live_grep) diff --git a/common/nvim/after/plugin/tree.lua b/common/nvim/after/plugin/tree.lua index aaed822..8a3e061 100644 --- a/common/nvim/after/plugin/tree.lua +++ b/common/nvim/after/plugin/tree.lua @@ -9,7 +9,6 @@ require("nvim-tree").setup({ enable = true, }, icons = { - git_placement = "after", symlink_arrow = " -> ", show = { file = false, @@ -25,8 +24,8 @@ require("nvim-tree").setup({ staged = "S", unmerged = "M", renamed = "R", - untracked = "A", - deleted = "D", + untracked = "+", + deleted = "-", ignored = "I", }, }, diff --git a/common/nvim/after/plugin/treesitter.lua b/common/nvim/after/plugin/treesitter.lua index df267fe..e6f3ad9 100644 --- a/common/nvim/after/plugin/treesitter.lua +++ b/common/nvim/after/plugin/treesitter.lua @@ -18,11 +18,5 @@ require("nvim-treesitter.configs").setup({ -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, }, - - playground = { - enable = true, - }, }) require("treesitter-context").setup() -require("nvim-ts-autotag").setup() -require("hlargs").setup() diff --git a/common/nvim/after/plugin/undotree.lua b/common/nvim/after/plugin/undotree.lua new file mode 100644 index 0000000..b6b9276 --- /dev/null +++ b/common/nvim/after/plugin/undotree.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) diff --git a/common/nvim/after/plugin/whitespace.lua b/common/nvim/after/plugin/whitespace.lua new file mode 100644 index 0000000..1bbdfe5 --- /dev/null +++ b/common/nvim/after/plugin/whitespace.lua @@ -0,0 +1,4 @@ +vim.g.better_whitespace_enable = true +vim.g.strip_whitespace_on_save = true + +vim.cmd("hi ExtraWhitespace ctermbg=9") diff --git a/common/nvim/lua/cc/packer.lua b/common/nvim/lua/cc/packer.lua index 457a617..9a5f95e 100644 --- a/common/nvim/lua/cc/packer.lua +++ b/common/nvim/lua/cc/packer.lua @@ -5,22 +5,21 @@ local packer = require("packer") return packer.startup(function(use) use("wbthomason/packer.nvim") - -- {{{ color scheme - use("owozsh/amora") - -- }}} - - -- {{{ treesitter + use({ + "nvim-telescope/telescope.nvim", + tag = "0.1.1", + requires = { + {"nvim-lua/plenary.nvim"}, + }, + }) use( "nvim-treesitter/nvim-treesitter", {run = ":TSUpdate"} ) - use("nvim-treesitter/playground") use("nvim-treesitter/nvim-treesitter-context") - use("windwp/nvim-ts-autotag") - use("m-demare/hlargs.nvim") - -- }}} + use("mbbill/undotree") + use("tpope/vim-fugitive") - -- {{{ lsp use({ "VonHeikemen/lsp-zero.nvim", branch = "v2.x", @@ -41,100 +40,17 @@ return packer.startup(function(use) {"L3MON4D3/LuaSnip"}, -- Required }, }) + + use("lukas-reineke/indent-blankline.nvim") + use("romgrk/barbar.nvim") + use("ntpeters/vim-better-whitespace") + use("nvim-tree/nvim-tree.lua") + use("andweeb/presence.nvim") + use("jose-elias-alvarez/null-ls.nvim") use("MunifTanjim/prettier.nvim") - use("ray-x/lsp_signature.nvim") - -- }}} - -- {{{ misc - use({ - "tpope/vim-fugitive", - config = function() - vim.keymap.set("n", "gs", vim.cmd.Git) - end - }) - use("lukas-reineke/indent-blankline.nvim") - use({ - "ntpeters/vim-better-whitespace", - config = function() - vim.g.better_whitespace_enable = true - vim.g.strip_whitespace_on_save = true - end - }) - use({ - "andweeb/presence.nvim", - config = function() - vim.g.presence_buttons = false - end - }) - use({ - "NvChad/nvim-colorizer.lua", - config = function() - require("colorizer").setup() - end - }) - use({ - "yamatsum/nvim-cursorline", - config = function() - require("nvim-cursorline").setup({ - cursorline = { - enable = false, - }, - cursorword = { - enable = true, - }, - }) - end - }) - use({ - "sunjon/shade.nvim", - config = function() - require("shade").setup({ - overlay_opacity = 25, - }) - end - }) - use({ - "windwp/nvim-autopairs", - config = function() - require("nvim-autopairs").setup() - end - }) - use("jghauser/mkdir.nvim") - use({ - "kylechui/nvim-surround", - config = function() - require("nvim-surround").setup() - end - }) - -- }}} - - -- {{{ ui - use({ - "nvim-telescope/telescope.nvim", - tag = "0.1.1", - requires = { - {"nvim-lua/plenary.nvim"}, - }, - }) - use({ - "mbbill/undotree", - config = function() - vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) - end - }) - use("romgrk/barbar.nvim") - use("nvim-tree/nvim-tree.lua") use("nvim-lualine/lualine.nvim") - use({ - "folke/which-key.nvim", - config = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - require("which-key").setup() - end - }) - -- }}} -- this is only here to shut up the message on startup require("barbar").setup({ diff --git a/common/nvim/lua/cc/remap.lua b/common/nvim/lua/cc/remap.lua index 02a5b52..5c4845d 100644 --- a/common/nvim/lua/cc/remap.lua +++ b/common/nvim/lua/cc/remap.lua @@ -2,18 +2,15 @@ vim.g.mapleader = " " vim.keymap.set("t", "", "") -vim.keymap.set("i", "", "", {silent = true}) -vim.keymap.set("i", "", "", {silent = true}) -vim.keymap.set({"i", "v"}, "", "", {remap = true}) +vim.keymap.set("!", "", "") +vim.keymap.set("!", "", "") +vim.keymap.set({"i", "v"}, "", "") +vim.keymap.set("c", "", "") -vim.keymap.set("v", "", ":m '>+1gv=gv", {silent = true}) -vim.keymap.set("v", "", ":m '<-2gv=gv", {silent = true}) - -vim.keymap.set("i", "", ":m+", {silent = true}) -vim.keymap.set("i", "", ":m-2", {silent = true}) - -vim.keymap.set("n", "", ":m+", {silent = true}) -vim.keymap.set("n", "", ":m-2", {silent = true}) +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") +vim.keymap.set("v", "", ":m '>+1gv=gv") +vim.keymap.set("v", "", ":m '<-2gv=gv") vim.keymap.set("n", "J", "mzJ`z") vim.keymap.set("n", "", "zz") @@ -28,8 +25,7 @@ vim.keymap.set({"n", "v"}, "d", "\"_d") vim.keymap.set("n", "Q", "") -vim.keymap.set("n", "s", [[:s/\<\>//gI]]) -vim.keymap.set("n", "S", [[:%s/\<\>//gI]]) +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) vim.keymap.set("n", "", function() vim.cmd("so")