require('plugins') -- comma as leader vim.g.mapleader = "," -- load legacy options vim.cmd([[ " so ~/.config/nvim/legacy.vim let $FZF_DEFAULT_COMMAND = 'rg --files --hidden' let g:tex_flavor='latex' ]]) require('completion') require('lsp-setup') -- nvim-treesitter require('nvim-treesitter.configs').setup { ensure_installed = { "c", "lua", "vim", "help", "query", "gitattributes", "gitcommit", "gitignore", "json", "markdown", "yaml", "toml", "make", "nix", "bash", "php", "html", "css", "python", "rust", }, highlight = { enable = true, }, } -- lualine theme require('lualine').setup { options = { theme = 'gruvbox', -- no separators between lualine elements section_separators = '', component_separators = '' } } -- to disable the default netrw file browser -- vim.g.loaded_netrw = 1 -- vim.g.loaded_netrwPlugin = 1 vim.opt.termguicolors = true require("bufferline").setup{} -- settings for neovide if vim.g.neovide then vim.o.guifont = "Iosevka Term Medium:h12" end vim.opt.backspace = "indent,eol,start" -- fix auto-completion vim.opt.wildmenu = true vim.opt.wildignorecase = true vim.opt.wildignore = "*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml,*.toc,*.nav,*.snm" -- BUFFER HANDLING --------------------------------- -- automatically reload files changed on disk but not in buffer vim.opt.autoread = true -- hide buffers on switch vim.opt.hidden = true -- OPTICS & NUMBERING BEHAVIOUR -------------------- vim.opt.number = true vim.opt.relativenumber = true vim.opt.tabstop = 4 vim.opt.shiftwidth = 4 vim.opt.expandtab = true -- keep 5 lines of context above/below the cursor (if possible) vim.opt.scrolloff = 5 -- SEARCH ------------------------------------------ -- highlight all search results vim.opt.hlsearch = true -- enable smart-case search vim.opt.smartcase = true -- always case-insensitive vim.opt.ignorecase = true -- searches for strings incrementally vim.opt.incsearch = true -- key bindings -- empty mode string matches n, v, o vim.keymap.set("", "h", ":tabp", { desc = "Select previous tab" }) vim.keymap.set("", "l", ":tabn", { desc = "Select next tab" }) vim.keymap.set("", "", ":bprevious", { desc = "Select previous buffer" }) vim.keymap.set("", "", ":bnext", { desc = "Select next buffer" }) vim.keymap.set("", "f", ":Files", { desc = "Open FZF file finder" }) vim.keymap.set("", "bl", ":Buffers", { desc = "Open FZF buffer list" }) vim.keymap.set("n", "1", "1w", { noremap = true }) vim.keymap.set("n", "2", "2w", { noremap = true }) vim.keymap.set("n", "3", "3w", { noremap = true }) vim.keymap.set("n", "4", "4w", { noremap = true }) vim.keymap.set("n", "5", "5w", { noremap = true }) vim.keymap.set("n", "6", "6w", { noremap = true }) vim.keymap.set("n", "7", "7w", { noremap = true }) vim.keymap.set("n", "8", "8w", { noremap = true }) vim.keymap.set("n", "9", "9w", { noremap = true }) vim.keymap.set("n", "0", "10w", { noremap = true })