--- /dev/null
+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",
+ "--single-branch",
+ "https://github.com/folke/lazy.nvim.git",
+ lazypath,
+ })
+end
+
+vim.opt.runtimepath:prepend(lazypath)
+
+require("lazy").setup("plugins", {
+ defaults = { lazy = true },
+ install = { colorscheme = { "tokyonight" } },
+ checker = { enabled = true },
+ change_detection = { notify = false, },
+ performance = {
+ rtp = {
+ disabled_plugins = {
+ "gzip",
+ "matchit",
+ "matchparen",
+ "netrwPlugin",
+ "tarPlugin",
+ "tohtml",
+ "tutor",
+ "zipPlugin",
+ },
+ },
+ },
+})
+
+require('settings')
+require('map')
+require('theme')
--- /dev/null
+-- quick creation for splits, tabs, buffers
+vim.keymap.set( 'n', '<leader>h', ":vsplit " )
+vim.keymap.set( 'n', '<leader>v', ":split " )
+vim.keymap.set( 'n', '<leader>t', ':tabnew ' )
+vim.keymap.set( 'n', '<leader>B', '<CMD>bnext<CR>' )
+
+-- fzf bindings
+vim.keymap.set( 'n', '<leader>H', "<CMD>call fzf#run({ 'sink': 'vertical botright split' })<CR>" )
+vim.keymap.set( 'n', '<leader>V', "<CMD>call fzf#run({ 'sink': 'botright split' })<CR>" )
+vim.keymap.set( 'n', '<leader>T', "<CMD>call fzf#run({ 'sink': 'tabnew' })<CR>" )
+vim.keymap.set( 'n', '<leader>f', '<CMD>GFiles<CR>' )
+vim.keymap.set( 'n', '<leader>F', '<CMD>Files<CR>' )
+vim.keymap.set( 'n', '<leader>b', '<CMD>Buffers<CR>' )
+vim.keymap.set( 'n', '<leader>r', '<CMD>History:<CR>' )
+
+-- move through virtual lines
+vim.keymap.set( 'n', 'j', 'gj' )
+vim.keymap.set( 'n', 'k', 'gk' )
+
+-- quick redo last macro
+vim.keymap.set( 'n', 'Q', '@@' )
+
+-- center the screen for movement commands
+vim.keymap.set( 'n', '<space>', 'za' )
+vim.keymap.set( 'n', 'n', 'nzz' )
+vim.keymap.set( 'n', 'N', 'Nzz' )
+vim.keymap.set( 'n', '<C-f>', '<C-f>zz' )
+vim.keymap.set( 'n', '<C-b>', '<C-b>zz' )
+vim.keymap.set( 'n', '<C-o>', '<C-o>zz' )
+vim.keymap.set( 'n', '<C-i>', '<C-i>zz' )
+
+-- normal mode line splitting and joining
+vim.keymap.set( 'n', 'H', 'i<CR><ESC>zzO' )
+vim.keymap.set( 'n', 'L', 'i<CR><ESC>zzi' )
+vim.keymap.set( 'n', 'K', 'Jx' )
+
+-- toggle ui elements
+vim.keymap.set( 'n', '_', '<CMD>nohlsearch<CR>' )
+vim.keymap.set( 'n', '<leader>u', '<CMD>UndotreeToggle<CR>' )
+vim.keymap.set( 'n', '<leader><Space>', '<CMD>ToggleTerm<CR>' )
+
+-- editing and reloading init.lua
+vim.keymap.set( 'n', '<leader>=', '<CMD>tabnew ~/.config/nvim/init.lua<CR>' )
+vim.keymap.set( 'n', '<leader>q',
+function()
+ vim.cmd('write')
+ vim.cmd('source ~/.config/nvim/init.lua')
+end )
+
+vim.keymap.set( 'n', '<leader>Q',
+function()
+ vim.cmd('write')
+ vim.cmd('source ~/.config/nvim/init.lua')
+ vim.cmd('PlugUpdate')
+end )
+
+-- autosave
+vim.keymap.set( 'i', '<ESC>', '<ESC><CMD>update<CR>' )
+
+-- better terminal movement keys
+vim.keymap.set('t', '<ESC>', [[<C-\><C-n>]], opts)
+vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
+
+-- lsp diagnostic navigation
+vim.keymap.set('n', '<leader>n', vim.diagnostic.goto_next, opts)
+vim.keymap.set('n', '<leader>p', vim.diagnostic.goto_prev, opts)
+vim.keymap.set('n', '<leader>l', vim.diagnostic.open_float, opts)
+-- vim.keymap.set('n', "<Leader>L", require("lsp_lines").toggle)
+vim.keymap.set('n', '<leader>R', vim.lsp.buf.rename, opts)
+vim.keymap.set('n', '<leader>k', vim.lsp.buf.hover)
--- /dev/null
+return {
+ 'tpope/vim-surround',
+ 'tpope/vim-obsession',
+ 'tpope/vim-endwise',
+ 'tpope/vim-repeat',
+ 'tpope/vim-commentary',
+ 'junegunn/fzf',
+ 'junegunn/fzf.vim',
+
+ 'lukas-reineke/indent-blankline.nvim',
+ 'christoomey/vim-tmux-navigator',
+ 'norcalli/nvim-colorizer.lua',
+ 'Maan2003/lsp_lines.nvim',
+ 'mbbill/undotree',
+
+ {
+ 'akinsho/toggleterm.nvim',
+ opts = {
+ shade_terminals = false,
+ size = 10
+ }
+ }
+}
--- /dev/null
+return {
+ {
+ 'hrsh7th/nvim-cmp',
+ dependencies = {
+ 'onsails/lspkind.nvim',
+ 'hrsh7th/cmp-nvim-lsp',
+ 'hrsh7th/cmp-buffer',
+ 'hrsh7th/cmp-path',
+ 'hrsh7th/cmp-cmdline',
+ },
+ opts = function()
+ local cmp = require('cmp')
+ return {
+ view = { entries = {name = 'custom', selection_order = 'near_cursor'} },
+ formatting = { format= require('lspkind').cmp_format({ mode = 'symbol_text' }), },
+ mapping = require('nvim-cmp').mapping.preset.insert({
+ ['<C-j>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
+ ['<C-k>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
+ ['<C-p>'] = cmp.mapping.scroll_docs(-4),
+ ['<C-n>'] = cmp.mapping.scroll_docs(4),
+ ['<CR>'] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, }),
+ }),
+ sources = cmp.config.sources({
+ { name = 'nvim_lsp' },
+ { name = 'path' },
+ { name = 'buffer' }
+ }),
+ cmdline(':', {
+ view = { entries = {name = 'wildmenu', separator = '|'} },
+ mapping = cmp.mapping.preset.cmdline(),
+ sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } })
+ })
+ }
+ end
+ },
+}
--- /dev/null
+return {
+ {
+ 'neovim/nvim-lspconfig',
+ dependencies = {
+ "mason.nvim",
+ "nvim-cmp",
+ "williamboman/mason-lspconfig.nvim",
+ },
+ opts = {
+ diagnostics = {
+ virtual_text = false,
+ virtual_lines = true,
+ signs = false,
+ underline = true,
+ update_in_insert = false,
+ severity_sort = true,
+ }
+ },
+ setup = {}
+ },
+
+ {
+ 'nvim-treesitter/nvim-treesitter',
+ opts = {
+ ensure_installed = {
+ "c",
+ "bash",
+ "comment",
+ "html",
+ "json",
+ "markdown",
+ "rust",
+ "regex",
+ "ruby"
+ },
+ sync_install = true,
+ auto_install = true,
+ highlight = { enable = true, additional_vim_regex_highlighting = true, },
+ indent = { enable = false },
+ }
+ },
+
+ {
+ "williamboman/mason.nvim",
+ cmd = "Mason",
+ opts = {
+ ensure_installed = {
+ "stylua",
+ "shfmt",
+ },
+ },
+ },
+
+ {
+ "jose-elias-alvarez/null-ls.nvim",
+ event = { "BufReadPre", "BufNewFile" },
+ dependencies = { "mason.nvim" },
+ opts = function()
+ local nls = require("null-ls")
+ return {
+ root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"),
+ sources = {
+ nls.builtins.formatting.stylua,
+ nls.builtins.formatting.shfmt,
+ },
+ }
+ end
+ },
+}
--- /dev/null
+return {
+ 'nvim-lualine/lualine.nvim',
+ lazy = false,
+ opts = {
+ options = {
+ icons_enabled = true,
+ theme = 'auto',
+ component_separators = { left = '|', right = '|'},
+ section_separators = { left = '', right = ''},
+ disabled_filetypes = {
+ statusline = {},
+ winbar = {},
+ },
+ ignore_focus = {},
+ always_divide_middle = true,
+ globalstatus = false,
+ refresh = {
+ statusline = 1000,
+ tabline = 1000,
+ winbar = 1000,
+ }
+ },
+ sections = {
+ lualine_a = {'mode'},
+ lualine_b = {{'filename', path = 3}},
+ lualine_c = {'git', 'branch', 'diff'},
+ lualine_x = {'encoding'},
+ lualine_y = {'diagnostics'},
+ lualine_z = {'location', 'progress'}
+ },
+ inactive_sections = {
+ lualine_a = {'filename'},
+ lualine_b = {{'filename', path = 3}},
+ lualine_c = {},
+ lualine_x = {},
+ lualine_y = {},
+ lualine_z = {'location'}
+ },
+ winbar = {
+ lualine_a = {'filename', 'filesize', 'filetype'},
+ lualine_b = {},
+ lualine_c = {},
+ lualine_x = {},
+ lualine_y = {},
+ lualine_z = {
+ {'tabs',
+ tabs_color = {
+ active = 'StatusLine',
+ inactive = 'StatusLineNC',
+ },
+ }
+ }
+ },
+ inactive_winbar = {
+ lualine_a = {'filename'},
+ lualine_b = {},
+ lualine_c = {},
+ lualine_x = {},
+ lualine_y = {},
+ lualine_z = {'ObsessionStatus'}
+ },
+ extensions = {}
+ }
+}
--- /dev/null
+vim.g.c_syntax_for_h = 1
+vim.g.termdebug_wide = 1
+
+vim.g.netrw_banner = 0
+vim.g.netrw_browse_split = 4
+vim.g.netrw_winsize = 20
+vim.g.netrw_liststyle = 4
+
+vim.o.mousefocus = true
+vim.o.mousemodel= 'extend'
+
+vim.o.lazyredraw = true
+
+vim.o.number = true
+vim.o.relativenumber = true
+
+vim.o.linebreak = true
+vim.o.breakindent = true
+vim.o.showbreak = '> '
+
+vim.o.ignorecase = true
+vim.o.infercase = true
+vim.o.smartcase = true
+vim.o.incsearch = true
+vim.o.hlsearch = true
+vim.o.history = 10000
+vim.o.showmatch = true
+
+vim.o.autochdir = true
+vim.o.browsedir = 'buffer'
+vim.o.cdhome = true
+
+vim.o.wrapscan = true
+vim.o.wildmenu = true
+-- vim.o.wildignore = { '*.docx','*.jpg','*.png','*.pdf','*.pyc','*.exe','*.flv','*.img','*.xlsx' }
+
+vim.o.tabstop = 4
+vim.o.shiftwidth = 4
+vim.o.autoindent = true
+vim.o.expandtab = true
+vim.o.shiftround = true
+
+vim.o.showcmd = true
+vim.o.cmdheight = 1
+vim.o.cmdwinheight = 10
+
+vim.o.backupdir = '/home/huck/.local/state/nvim/backup'
+vim.o.undodir = '/home/huck/.local/state/nvim/undo'
+
+vim.o.backup = true
+vim.o.undofile = true
+vim.o.swapfile = false
+vim.o.undolevels = 2000
+vim.o.undoreload = 2000
+
+vim.o.autoread = true
+
+vim.o.foldenable = true
+vim.o.foldlevelstart = 5
+vim.o.foldmethod = 'indent'
+-- vim.o.foldmarker = { '-v-','-^-' }
+-- vim.o.backspace = { 'indent','eol','start' }
+
+vim.o.ttimeout = true
+vim.o.ttimeoutlen = 1
+vim.o.confirm = true
+
+vim.o.splitright = true
+vim.o.splitbelow = true
+
+vim.o.showtabline = 0
+vim.o.termguicolors = true
+-- vim.o.completeopt = { 'menu', 'menuone', 'noselect' }
+
+vim.o.pumblend = 30
+vim.o.pumwidth = 50
+
+vim.o.jumpoptions = 'stack'
+vim.o.so = 10
+
--- /dev/null
+vim.cmd([[
+
+let backg = "#151515"
+let foreg = "#d7d0c7"
+let black = "#101010"
+let grey = "#404040"
+let red = "#e84f4f"
+let redb = "#d23d3d"
+let green = "#b8d68c"
+let greenb = "#a0cf5d"
+let yellow = "#e1aa5d"
+let yellowb = "#f39d21"
+let blue = "#7dc1cf"
+let blueb = "#4e9fb1"
+let magenta = "#9b64fb"
+let magentab = "#8542ff"
+let cyan = "#20a494"
+let cyanb = "#21d6c7"
+let white = "#909090"
+let whiteb = "#dddddd"
+
+execute "highlight Normal guibg=" . backg
+execute "highlight Normal guifg=" . foreg
+execute "highlight comment guifg=" . white
+execute "highlight LineNr guifg=" . yellow
+execute "highlight CursorLineNr guifg=" . red
+execute "highlight MatchParen guibg=" . grey
+execute "highlight Constant guifg=" . magenta
+execute "highlight Identifier guifg=" . blue
+execute "highlight Statement guifg=" . greenb
+execute "highlight Type guifg=" . blueb
+execute "highlight PreProc guifg=" . yellowb
+execute "highlight Title guifg=" . greenb
+execute "highlight Question guifg=" . green
+execute "highlight WildMenu guibg=" . yellow
+execute "highlight WildMenu guibg=" . backg
+execute "highlight SpecialKey guifg=" . cyan
+execute "highlight NonText guifg=" . cyan
+execute "highlight Directory guifg=" . blueb
+execute "highlight ToolBarLine guibg=" . grey
+execute "highlight ToolBarLine guifg=" . foreg
+execute "highlight Error guibg=" . redb
+execute "highlight Error guifg=" . foreg
+execute "highlight Todo guibg=" . yellow
+execute "highlight Todo guifg=" . backg
+execute "highlight ErrorMsg guibg=" . redb
+execute "highlight ErrorMsg guifg=" . foreg
+execute "highlight Search guibg=" . green
+execute "highlight Search guifg=" . backg
+execute "highlight WarningMsg guifg=" . redb
+execute "highlight Visual guibg=" . grey
+execute "highlight Visual guifg=" . foreg
+execute "highlight DiffAdd guibg=" . greenb
+execute "highlight DiffAdd guifg=" . backg
+execute "highlight DiffText guibg=" . cyan
+execute "highlight DiffText guifg=" . foreg
+execute "highlight DiffDelete guibg=" . grey
+execute "highlight DiffDelete guifg=" . redb
+execute "highlight DiffChange guibg=" . magenta
+execute "highlight DiffChange guifg=" . foreg
+execute "highlight Folded guibg=" . grey
+execute "highlight Folded guifg=" . blueb
+execute "highlight FoldColumn guibg=" . grey
+execute "highlight FoldColumn guifg=" . blueb
+execute "highlight Pmenu guifg=" . foreg
+execute "highlight Pmenu guibg=" . grey
+execute "highlight PmenuSel guibg=" . grey
+execute "highlight PmenuSel guifg=" . green
+execute "highlight VertSplit guibg=" . backg
+execute "highlight VertSplit guifg=" . grey
+execute "highlight StatusLineNC guibg=" . backg
+execute "highlight StatuslineNC guifg=" . grey
+execute "highlight StatusLine guibg=" . foreg
+execute "highlight Statusline guifg=" . grey
+execute "highlight NvimInternalError guifg=" . backg
+execute "highlight TabLine guifg=" . backg
+execute "highlight TabLine guibg=" . grey
+execute "highlight TabLineFill guibg=" . backg
+execute "highlight TabLineFill guifg=" . grey
+execute "highlight TabLineSel gui= bold guifg=" . foreg
+execute "highlight TabLineSel guibg=" . grey
+
+execute "highlight SignColumn guibg=" . grey
+execute "highlight DiagnosticError guifg=" . redb
+execute "highlight DiagnosticWarn guifg=" . yellowb
+execute "highlight DiagnosticInfo guifg=" . blue
+execute "highlight DiagnosticHint guifg=" . grey
+
+execute "highlight! CmpItemAbbrDeprecated guibg=NONE gui=strikethrough guifg=" . grey
+execute "highlight! CmpItemAbbrMatch guibg=NONE guifg=" . blue
+execute "highlight! CmpItemAbbrMatchFuzzy guibg=NONE guifg=" . blue
+execute "highlight! CmpItemKindVariable guibg=NONE guifg=" . cyan
+execute "highlight! CmpItemKindInterface guibg=NONE guifg=" . cyan
+execute "highlight! CmpItemKindText guibg=NONE guifg=" . cyan
+execute "highlight! CmpItemKindFunction guibg=NONE guifg=" . magenta
+execute "highlight! CmpItemKindMethod guibg=NONE guifg=" . magenta
+execute "highlight! CmpItemKindKeyword guibg=NONE guifg=" . foreg
+execute "highlight! CmpItemKindProperty guibg=NONE guifg=" . foreg
+execute "highlight! CmpItemKindUnit guibg=NONE guifg=" . foreg
+
+
+execute "highlight IndentBlanklineChar guifg=" . grey
+execute "highlight IndentBlanklineSpaceChar guifg=" . grey
+execute "highlight IndentBlanklineSpaceCharBlankline guifg=" . grey
+execute "highlight IndentBlanklineChar guifg=" . grey
+]])