-- https://github.com/nvim-lua/kickstart.nvim -- https://www.youtube.com/watch?v=stqUbv-5u2s -- https://www.youtube.com/watch?v=w7i4amO_zaE local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim' local is_bootstrap = false if vim.fn.empty(vim.fn.glob(install_path)) > 0 then is_bootstrap = true vim.fn.system { 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path } vim.cmd [[packadd packer.nvim]] end ------------------------------------------------------------------------- -- From: https://github.com/nvim-tree/nvim-tree.lua -- disable netrw at the very start of your init.lua (strongly advised) -- vim.g.loaded_netrw = 1 -- vim.g.loaded_netrwPlugin = 1 ------------------------------------------------------------------------- require("mitch") vim.cmd [[packadd packer.nvim]] -- vim.cmd [[colorscheme nord]] require('packer').startup(function(use) -- Packer can manage itself use 'wbthomason/packer.nvim' use { 'nvim-telescope/telescope.nvim', tag = '0.1.4', requires = { {'nvim-lua/plenary.nvim'} } } -- Themes use 'shaunsingh/nord.nvim' use { "catppuccin/nvim", as = "catppuccin" } use { "olivertaylor/vacme" } -- use 'ellisonleao/gruvbox.nvim' -- use 'shaunsingh/solarized.nvim' use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) use 'nvim-treesitter/playground' use 'mbbill/undotree' use 'tpope/vim-fugitive' use { 'VonHeikemen/lsp-zero.nvim', requires = { -- LSP Support {'neovim/nvim-lspconfig'}, {'williamboman/mason.nvim'}, {'williamboman/mason-lspconfig.nvim'}, -- Autocompletion {'hrsh7th/nvim-cmp'}, {'hrsh7th/cmp-buffer'}, {'hrsh7th/cmp-path'}, {'saadparwaiz1/cmp_luasnip'}, {'hrsh7th/cmp-nvim-lsp'}, {'hrsh7th/cmp-nvim-lua'}, -- Snippets {'L3MON4D3/LuaSnip'}, {'rafamadriz/friendly-snippets'}, } } use 'mattn/emmet-vim' use 'lewis6991/gitsigns.nvim' -- replacement for syntastic, seems to work okay out of the box -- use 'dense-analysis/ale' use { 'nvim-lualine/lualine.nvim', -- status line config = function () end } use 'simrat39/symbols-outline.nvim' use 'numToStr/Comment.nvim' -- "gc" to comment visual regions/lines use 'fatih/vim-go' end) require('symbols-outline').setup { symbols = { File = {icon = "[f]", hl = "TSURI"}, Module = {icon = "[m]", hl = "TSNamespace"}, Namespace = {icon = "[n]", hl = "TSNamespace"}, Package = {icon = "[p]", hl = "TSNamespace"}, Class = {icon = "->", hl = "TSType"}, Method = {icon = "->", hl = "TSMethod"}, Property = {icon = "->", hl = "TSMethod"}, Field = {icon = "->", hl = "TSField"}, Constructor = {icon = "[con]", hl = "TSConstructor"}, Enum = {icon = "[en]", hl = "TSType"}, Interface = {icon = "[i]", hl = "TSType"}, Function = {icon = "[func]", hl = "TSFunction"}, Variable = {icon = "[var]", hl = "TSConstant"}, Constant = {icon = "[const]", hl = "TSConstant"}, String = {icon = "[s]", hl = "TSString"}, Number = {icon = "[num]", hl = "TSNumber"}, Boolean = {icon = "[bool]", hl = "TSBoolean"}, Array = {icon = "[arr]", hl = "TSConstant"}, Object = {icon = "[obj]", hl = "TSType"}, Key = {icon = "[key]", hl = "TSType"}, Null = {icon = "NULL", hl = "TSType"}, EnumMember = {icon = "[enm]", hl = "TSField"}, Struct = {icon = "[struct]", hl = "TSType"}, Event = {icon = "[ev]", hl = "TSType"}, Operator = {icon = "[op]", hl = "TSOperator"}, TypeParameter = {icon = "[tparm]", hl = "TSParameter"} } } -- vim.g.nord_contrast = true -- vim.g.nord_borders = false vim.g.nord_disable_background = true vim.g.nord_italic = false -- vim.g.nord_uniform_diff_background = true vim.g.nord_bold = false -- Load the colorscheme require('nord').set() LuaLineConf = { options = { icons_enabled = false, component_separators = '|', section_separators = '', theme = 'nord', }, sections = { lualine_a = {'mode'}, lualine_b = {'branch', 'diff', 'diagnostics'}, lualine_c = { { 'filename', file_status = true, -- 0 filename -- 1 relative path -- 2 abs path -- 3 abs path with ~ path = 3 }, }, lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_y = {'progress'}, lualine_z = {'location'} } } require('lualine').setup(LuaLineConf) require('Comment').setup() require('gitsigns').setup { signs = { add = { text = '+' }, change = { text = '~' }, delete = { text = '_' }, topdelete = { text = '‾' }, changedelete = { text = '~' }, }, } -- telescope vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) vim.keymap.set('n', 'sb', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) vim.keymap.set('n', '/', function() -- You can pass additional configuration to telescope to change theme, layout, etc. require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { winblend = 10, previewer = false, }) end, { desc = '[/] Fuzzily search in current buffer]' }) vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) local builtin = require('telescope.builtin') vim.keymap.set('n', '', builtin.find_files, {}) vim.keymap.set('n', '', builtin.git_files, {}) vim.keymap.set('n', 'ps', function() builtin.grep_string({ search = vim.fn.input("Grep > ") }) end) vim.keymap.set('n', 'so', function() vim.cmd('SymbolsOutline') end) vim.api.nvim_create_user_command( 'SetNord', function() LuaLineConf.options.theme = 'nord'; require('nord').set() require('lualine').setup(LuaLineConf) end, { nargs = 0 } ) vim.api.nvim_create_user_command( 'SetAcme', function() LuaLineConf.options.theme = 'gruvbox_light'; vim.api.nvim_command('colorscheme vacme'); require('lualine').setup(LuaLineConf) end, { nargs = 0 } ) -- Expose vim.diagnostic.enable/disable as a quick toggle ex command local diag = true vim.api.nvim_create_user_command( 'DiagToggle', function() if diag then vim.diagnostic.disable() diag = false else vim.diagnostic.enable() diag = true end end, { nargs = 0 } )