diff --git a/.gitignore b/.gitignore index 353ea04..8a3b7ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ **/autostart.sh **/bookmarks +**/lazy-lock.json **/.netrwhist **/__pycache__ diff --git a/nvim/init.vim b/_unused/init.vim similarity index 100% rename from nvim/init.vim rename to _unused/init.vim diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..c552459 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,98 @@ +-- install Lazy +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- define plugins +require("lazy").setup { + { "tanvirtin/monokai.nvim", config = function() require("monokai").setup() end }, + { "NvChad/nvim-colorizer.lua", config = function() require("colorizer").setup() end }, + { "numToStr/Comment.nvim", config = function() require("Comment").setup() end }, + -- "bitc/vim-bad-whitespace", + "lewis6991/gitsigns.nvim", + "nvim-lualine/lualine.nvim", + "nvim-treesitter/nvim-treesitter", +} + +-- configure plugins, if needed +require("gitsigns").setup { + signs = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "▎" }, + topdelete = { text = "契" }, + changedelete = { text = "▎" }, + untracked = { text = "▎" }, + }, +} +require("lualine").setup { + options = { + component_separators = '', + icons_enabled = false, + section_separators = '', + theme = "powerline", + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { { "filename", file_status = true, path = 1 } }, + lualine_c = { "branch" }, + lualine_x = { "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, +} +require("nvim-treesitter.configs").setup { + build = ":TSUpdate", + ensure_installed = { "bash", "python", "terraform", "vim", "yaml" }, + highlight = { enable = true }, +} + +-- modify colorcheme +vim.api.nvim_set_hl(0, "Normal", { bg = NONE }) +vim.api.nvim_set_hl(0, "NonText", { bg = NONE }) +vim.api.nvim_set_hl(0, "BadWhitespace", { bg = "#770000" }) +vim.api.nvim_set_hl(0, "ColorColumn", { bg = "#770000" }) +vim.api.nvim_set_hl(0, "DiffChange", { bg = NONE, fg = "#e7c547" }) +vim.api.nvim_set_hl(0, "DiffText", { bg = NONE, fg = "#ff8700" }) +vim.api.nvim_set_hl(0, "LineNr", { bg = NONE, fg = "#465457" }) +vim.api.nvim_set_hl(0, "Visual", { bg = "#005577", fg = "#ffffff" }) +vim.api.nvim_set_hl(0, "SpellBad", { bg = "#770000", fg = "#ffffff" }) + +-- global options +vim.opt.cursorline = true +vim.opt.expandtab = true +vim.opt.gdefault = true +vim.opt.hlsearch = false +vim.opt.ignorecase = true +vim.opt.number = true +vim.opt.shiftround = true +vim.opt.showmode = false +vim.opt.smartcase = true +vim.opt.splitbelow = true +vim.opt.splitright = true +vim.opt.termguicolors = true +vim.opt.writebackup = false +vim.opt.mouse = "" +vim.opt.tabstop = 2 +vim.opt.scrolloff = 5 +vim.opt.updatetime = 100 +vim.opt.shiftwidth = 2 +vim.opt.showtabline = 0 +vim.opt.softtabstop = 2 + +-- configure mappings +vim.g.mapleader = " " +vim.api.nvim_set_keymap('n', "", ":wq!", { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', "c", ":execute 'set colorcolumn=' . (&colorcolumn == '' ? '80,120' : '')", { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', "n", ":set nonumber!:Gitsigns toggle_signs", { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', "s", ":set spell!", { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', "", "w", { noremap = true, silent = true }) diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index a02b84f..fef4b38 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -31,7 +31,7 @@ fi function ud() { wd dots && git pull for i in $XDG_DATA_HOME/repos/zsh_modules/*; do sh -c "cd $i && git pull"; done - nvim -c "PlugUpdate" -c "PlugClean" -c "q" -c "q" + nvim --headless -c "Lazy sync" -c "q" rm -rf ~/go cd }