--[ GLOBAL ]-- vim.o.background = "dark" vim.cmd([[colorscheme gruvbox]]) vim.g.mapleader = ";" vim.o.signcolumn = "yes" vim.wo.number = true vim.wo.relativenumber = true vim.wo.cursorline = true --[ LSPCONFIG ]-- local opts = { noremap=true, silent=true } local on_attach = function(client, bufnr) vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') local bufopts = { noremap=true, silent=true, buffer=bufnr } vim.keymap.set('n', 'D', vim.lsp.buf.declaration, bufopts) vim.keymap.set('n', 'd', vim.lsp.buf.definition, bufopts) vim.keymap.set('n', 'h', vim.lsp.buf.hover, bufopts) vim.keymap.set('n', 'i', vim.lsp.buf.implementation, bufopts) vim.keymap.set('n', 's', vim.lsp.buf.signature_help, bufopts) vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) vim.keymap.set('n', 'c', vim.lsp.buf.code_action, bufopts) vim.keymap.set('n', 'fmt', function() vim.lsp.buf.format { async = true } end, bufopts) end require'lspconfig'.nil_ls.setup{ on_attach = on_attach } require'lspconfig'.pyright.setup{} --[ LEAP ]-- require('leap').add_default_mappings() -- Don't remap 'x' in visual mode. vim.keymap.del({'x', 'o'}, 'x') vim.keymap.del({'x', 'o'}, 'X') --[ TELESCOPE ]-- local builtin = require('telescope.builtin') vim.keymap.set('n', 'ff', builtin.find_files, {}) vim.keymap.set('n', 'fg', builtin.live_grep, {}) vim.keymap.set('n', 'fb', builtin.buffers, {}) vim.keymap.set('n', 'fr', builtin.lsp_references, {}) vim.keymap.set('n', 'fs', builtin.lsp_document_symbols, {}) require('telescope').setup{ pickers = { find_files = { theme = "dropdown" }, live_grep = { theme = "dropdown" }, buffers = { theme = "dropdown" }, lsp_references = { theme = "dropdown" }, lsp_document_symbols = { theme = "dropdown" } } } --[ COMMENTARY ]-- vim.cmd([[autocmd FileType nix setlocal commentstring=#\ %s]]) --[ GITSIGNS ]-- require("gitsigns").setup()