diff options
| -rw-r--r-- | init.lua | 106 |
1 files changed, 63 insertions, 43 deletions
| @@ -1,6 +1,8 @@ | |||
| 1 | -- require("config.lsp") | 1 | -- require("config.lsp") |
| 2 | local option = vim.opt | 2 | local option = vim.opt |
| 3 | local keymap = vim.keymap | 3 | local keymap = vim.keymap |
| 4 | vim.g.loaded_netrw = 1 | ||
| 5 | vim.g.loaded_netrwPlugin = 1 | ||
| 4 | 6 | ||
| 5 | --Basic Editor Setup | 7 | --Basic Editor Setup |
| 6 | option.nu = true | 8 | option.nu = true |
| @@ -22,48 +24,6 @@ option.termguicolors = true | |||
| 22 | option.fillchars = 'eob: ' | 24 | option.fillchars = 'eob: ' |
| 23 | option.autoindent = true | 25 | option.autoindent = true |
| 24 | 26 | ||
| 25 | -- Setup Editor Theme | ||
| 26 | vim.cmd([[ | ||
| 27 | highlight GitGutterAdd ctermbg=none | ||
| 28 | highlight GitGutterAdd guibg=none | ||
| 29 | highlight NonText guifg=none | ||
| 30 | highlight EndOfBuffer ctermfg=none ctermbg=none | ||
| 31 | highlight Normal ctermbg=none | ||
| 32 | highlight Normal guibg=none | ||
| 33 | highlight signcolumn ctermbg=none | ||
| 34 | highlight signcolumn guibg=none | ||
| 35 | highlight StatusLine ctermbg=none | ||
| 36 | highlight StatusLine guibg=none | ||
| 37 | highlight DiagnosticError ctermbg=none | ||
| 38 | highlight DiagnosticError guibg=none | ||
| 39 | highlight DiagnosticWarn ctermbg=none | ||
| 40 | highlight DiagnosticWarn guibg=none | ||
| 41 | highlight DiagnosticInfo ctermbg=none | ||
| 42 | highlight DiagnosticInfo guibg=none | ||
| 43 | highlight DiagnosticHint ctermbg=none | ||
| 44 | highlight DiagnosticHint guibg=none | ||
| 45 | highlight Pmenu ctermbg=none guibg=none | ||
| 46 | |||
| 47 | highlight DiagnosticVirtualError ctermbg=none | ||
| 48 | highlight DiagnosticVirtualError guibg=none | ||
| 49 | highlight DiagnosticVirtualWarn ctermbg=none | ||
| 50 | highlight DiagnosticVirtualWarn guibg=none | ||
| 51 | highlight DiagnosticVirtualInfo ctermbg=none | ||
| 52 | highlight DiagnosticVirtualInfo guibg=none | ||
| 53 | highlight DiagnosticVirtualHint ctermbg=none | ||
| 54 | highlight DiagnosticVirtualHint guibg=none | ||
| 55 | |||
| 56 | highlight DiagnosticVirtualTextError ctermbg=none | ||
| 57 | highlight DiagnosticVirtualTextError guibg=none | ||
| 58 | highlight DiagnosticVirtualTextWarn ctermbg=none | ||
| 59 | highlight DiagnosticVirtualTextWarn guibg=none | ||
| 60 | highlight DiagnosticVirtualTextInfo ctermbg=none | ||
| 61 | highlight DiagnosticVirtualTextInfo guibg=none | ||
| 62 | highlight DiagnosticVirtualTextHint ctermbg=none | ||
| 63 | highlight DiagnosticVirtualTextHint guibg=none | ||
| 64 | ]]) | ||
| 65 | |||
| 66 | -- run specific commands after different file extensions | ||
| 67 | vim.cmd([[ | 27 | vim.cmd([[ |
| 68 | augroup RunPfOnSave | 28 | augroup RunPfOnSave |
| 69 | autocmd! | 29 | autocmd! |
| @@ -82,7 +42,7 @@ vim.g.gitgutter_set_sign_backgrounds = 1 | |||
| 82 | 42 | ||
| 83 | --Keybinds | 43 | --Keybinds |
| 84 | vim.g.mapleader = " " | 44 | vim.g.mapleader = " " |
| 85 | keymap.set("n", "<leader>e", vim.cmd.Ex) | 45 | keymap.set("n", "<leader>e", vim.cmd.NvimTreeToggle) |
| 86 | keymap.set("n", "<leader>z", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]]) | 46 | keymap.set("n", "<leader>z", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]]) |
| 87 | keymap.set("n", "<leader>a", "ggVG") | 47 | keymap.set("n", "<leader>a", "ggVG") |
| 88 | keymap.set("n", "<leader>y", "cc") | 48 | keymap.set("n", "<leader>y", "cc") |
| @@ -106,8 +66,10 @@ end | |||
| 106 | vim.opt.rtp:prepend(lazypath) | 66 | vim.opt.rtp:prepend(lazypath) |
| 107 | require("lazy").setup({ | 67 | require("lazy").setup({ |
| 108 | "nvim-lua/plenary.nvim", | 68 | "nvim-lua/plenary.nvim", |
| 69 | 'chriskempson/base16-vim', | ||
| 109 | "airblade/vim-gitgutter", | 70 | "airblade/vim-gitgutter", |
| 110 | "lervag/vimtex", | 71 | "lervag/vimtex", |
| 72 | "nvim-tree/nvim-tree.lua", | ||
| 111 | "norcalli/nvim-colorizer.lua", | 73 | "norcalli/nvim-colorizer.lua", |
| 112 | "nvim-treesitter/nvim-treesitter", | 74 | "nvim-treesitter/nvim-treesitter", |
| 113 | "neovim/nvim-lspconfig", | 75 | "neovim/nvim-lspconfig", |
| @@ -178,3 +140,61 @@ for lsp, settings in pairs(lsp_servers) do | |||
| 178 | settings = settings, | 140 | settings = settings, |
| 179 | })) | 141 | })) |
| 180 | end | 142 | end |
| 143 | |||
| 144 | require("nvim-tree").setup() | ||
| 145 | |||
| 146 | -- OR setup with some options | ||
| 147 | require("nvim-tree").setup({ | ||
| 148 | sort = { | ||
| 149 | sorter = "case_sensitive", | ||
| 150 | }, | ||
| 151 | view = { | ||
| 152 | width = 30, | ||
| 153 | }, | ||
| 154 | renderer = { | ||
| 155 | group_empty = true, | ||
| 156 | }, | ||
| 157 | filters = { | ||
| 158 | dotfiles = true, | ||
| 159 | }, | ||
| 160 | }) | ||
| 161 | |||
| 162 | vim.cmd.colorscheme("base16-brewer") | ||
| 163 | vim.cmd([[ | ||
| 164 | highlight GitGutterAdd ctermbg=none guibg=none | ||
| 165 | highlight GitGutterDelete guibg=none ctermbg=none | ||
| 166 | highlight NonText guifg=none | ||
| 167 | highlight EndOfBuffer ctermfg=none ctermbg=none | ||
| 168 | highlight Normal ctermbg=none | ||
| 169 | highlight Normal guibg=none | ||
| 170 | highlight signcolumn ctermbg=none | ||
| 171 | highlight signcolumn guibg=none | ||
| 172 | highlight StatusLine ctermbg=none | ||
| 173 | highlight StatusLine guibg=none | ||
| 174 | highlight DiagnosticError ctermbg=none | ||
| 175 | highlight DiagnosticError guibg=none | ||
| 176 | highlight DiagnosticWarn ctermbg=none | ||
| 177 | highlight DiagnosticWarn guibg=none | ||
| 178 | highlight DiagnosticInfo ctermbg=none | ||
| 179 | highlight DiagnosticInfo guibg=none | ||
| 180 | highlight DiagnosticHint ctermbg=none | ||
| 181 | highlight DiagnosticHint guibg=none | ||
| 182 | highlight Pmenu ctermbg=none guibg=none | ||
| 183 | |||
| 184 | highlight DiagnosticVirtualError ctermbg=none | ||
| 185 | highlight DiagnosticVirtualError guibg=none | ||
| 186 | highlight DiagnosticVirtualWarn ctermbg=none | ||
| 187 | highlight DiagnosticVirtualWarn guibg=none | ||
| 188 | highlight DiagnosticVirtualInfo ctermbg=none | ||
| 189 | highlight DiagnosticVirtualInfo guibg=none | ||
| 190 | highlight DiagnosticVirtualHint ctermbg=none | ||
| 191 | highlight DiagnosticVirtualHint guibg=none | ||
| 192 | |||
| 193 | highlight LineNr ctermbg=none guibg=none | ||
| 194 | highlight StatusLineNc ctermbg=none guibg=none | ||
| 195 | |||
| 196 | highlight DiagnosticVirtualTextError ctermbg=none guibg=none | ||
| 197 | highlight DiagnosticVirtualTextWarn ctermbg=none guibg=none | ||
| 198 | highlight DiagnosticVirtualTextInfo ctermbg=none guibg=none | ||
| 199 | highlight DiagnosticVirtualTextHint ctermbg=none guibg=none | ||
| 200 | ]]) | ||
