diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..4dad3dd --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,74 @@ +-- Leader have to be set before any plugins are loaded +vim.g.mapleader = " " + +-- Various mappings +vim.keymap.set("i", "jk", "") + +-- Enable termguicolors +vim.opt.termguicolors = true + +-- Line numbers +vim.opt.number = true +vim.opt.relativenumber = true + + +-- Use OS clipboard for yank/paste +vim.opt.clipboard = "unnamedplus" + +-- Tab and indent settings +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true +vim.opt.smarttab = true +vim.opt.autoindent = true + +-- Highlight without moving +vim.keymap.set("n", "*", "*``") + +-- More natural split directions +vim.opt.splitbelow = true +vim.opt.splitright = true + +-- Auto-resize splits when terminal window changes size +-- (e.g. when splitting or zooming with tmux) +vim.api.nvim_create_autocmd( {"VimResized"}, {pattern = "*", command = "wincmd ="}) + +-- Keep some lines above/below cursor +vim.opt.scrolloff = 10 + +-- Disable mouse (default on since neovim 0.8) +vim.opt.mouse = "" + +-- Show trailing whitespace etc +vim.opt.list = true +vim.opt.listchars = {tab = ">-", trail = "-", nbsp = "+"} + +-- Autocommands +local augroup_julia = vim.api.nvim_create_augroup("FileTypeJulia", {}) +vim.api.nvim_create_autocmd( + {"FileType"}, + { + group = augroup_julia, + pattern = "julia", + callback = function(ev) + vim.opt_local.textwidth = 92 + vim.opt_local.colorcolumn = "93" + end, + } +) + +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) +end +vim.opt.rtp:prepend(lazypath) + +-- Load lazy and configure plugins +require("lazy").setup({ + spec = {import = "plugins"}, + install = {colorscheme = {"catppuccin-mocha"}}, + change_detection = {notify = false}, +}) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim deleted file mode 100644 index 7ac62c6..0000000 --- a/.config/nvim/init.vim +++ /dev/null @@ -1,163 +0,0 @@ -set runtimepath^=~/.vim runtimepath+=~/.vim/after -let &packpath = &runtimepath -source ~/.vimrc - -lua << EOF - --- Setup nvim-cmp. -vim.opt.completeopt = {"menu", "menuone", "noselect"} - -local cmp = require('cmp') -local cmp_types = require('cmp.types') -local source_mapping = {buffer = '[Buffer]', nvim_lsp = '[LSP]'} - -cmp.setup({ - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = cmp.mapping.preset.insert({ - -- [''] = cmp.mapping(cmp.mapping.select_next_item({ behavior = cmp_types.cmp.SelectBehavior.Insert })), - -- This is to make the hotkey for both initiating completion and select next item - [''] = function(fallback) - if cmp.visible() then - cmp.select_next_item({ behavior = cmp_types.cmp.SelectBehavior.Insert }) - elseif (function() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end)() then - cmp.complete() - else - fallback() - end - end, - [''] = cmp.mapping.select_prev_item({ behavior = cmp_types.cmp.SelectBehavior.Insert }), - [''] = cmp.mapping.scroll_docs( 4), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.complete(), -- same as above - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = false }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - }, - { - { name = 'buffer' }, - }), - completion = {keyword_length = 4}, - formatting = { - format = function(entry, vim_item) - vim_item.menu = source_mapping[entry.source.name] - return vim_item - end, - }, -}) - --- Setup lspconfig: capabilities is passed to lspconfig.$server.setup -local capabilities = require('cmp_nvim_lsp').default_capabilities() - --- Set LSP keymappings in on_attach (i.e. only in buffers with LSP active) -local on_attach = function(client, bufnr) - local opts = { noremap=true, silent=true } - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'lrn', 'lua vim.lsp.buf.rename()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'lrr', 'lua vim.lsp.buf.references()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'lca', 'lua vim.lsp.buf.code_action({apply = true})', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'lqf', 'lua vim.lsp.buf.code_action({apply = true})', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'i', '', 'lua vim.lsp.buf.signature_help()', opts) -end - --- Julia LSP (LanguageServer.jl) -local REVISE_LANGUAGESERVER = false -require'lspconfig'.julials.setup({ - on_new_config = function(new_config, _) - local julia = vim.fn.expand("~/.julia/environments/nvim-lspconfig/bin/julia") - if REVISE_LANGUAGESERVER then - new_config.cmd[5] = (new_config.cmd[5]):gsub("using LanguageServer", "using Revise; using LanguageServer; LanguageServer.USE_REVISE[] = true") - elseif require'lspconfig'.util.path.is_file(julia) then - new_config.cmd[1] = julia - end - end, - -- This just adds dirname(fname) as a fallback (see nvim-lspconfig#1768). - root_dir = function(fname) - local util = require'lspconfig.util' - return util.root_pattern 'Project.toml'(fname) or util.find_git_ancestor(fname) or - util.path.dirname(fname) - end, - on_attach = function(client, bufnr) - on_attach(client, bufnr) - -- Disable automatic formatexpr since the LS.jl formatter isn't so nice. - vim.bo[bufnr].formatexpr = '' - end, - capabilities = capabilities, -}) - --- Rust LSP (rust_analyzer) -require('lspconfig').rust_analyzer.setup({ - on_attach = on_attach, - capabilities = capabilities, -}) - --- C/++ LSP (clangd) -require('lspconfig').clangd.setup({ - on_attach = on_attach, - capabilities = capabilities, -}) - --- null-ls -require("null-ls").setup({ - sources = { - require("null-ls").builtins.diagnostics.shellcheck, - }, -}) - --- Go LSP (gopls) -require('lspconfig').gopls.setup({ - on_attach = on_attach, - capabilities = capabilities, -}) - --- YAML LSP (yaml-language-server) -require('lspconfig').yamlls.setup({ - on_attach = on_attach, - capabilities = capabilities, -}) - --- Ansible LSP (ansible-language-server) -require'lspconfig'.ansiblels.setup({ - on_attach = on_attach, - capabilities = capabilities, -}) - --- Terraform LSP (terraform-ls) -require'lspconfig'.terraformls.setup({ - on_attach = on_attach, - capabilities = capabilities, -}) - - -require('gitsigns').setup({ - signs = { - add = { text = '+'}, - change = { text = '±'}, - }, - on_attach = function(bufnr) - -- Hunk navigation - local opts = { expr=true, noremap=true, silent=true, } - vim.api.nvim_buf_set_keymap(bufnr, 'n', ']c', "&diff ? ']c' : 'Gitsigns next_hunk'", opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '[c', "&diff ? '[c' : 'Gitsigns prev_hunk'", opts) - -- Hunk actions - local opts = { noremap=true, silent=true, } - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'hs', 'Gitsigns stage_hunk', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'hr', 'Gitsigns reset_hunk', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'hp', 'Gitsigns preview_hunk', opts) - end, - attach_to_untracked = false, -}) - --- require('coverage').setup() - -EOF diff --git a/.config/nvim/lua/plugins/airline.lua b/.config/nvim/lua/plugins/airline.lua new file mode 100644 index 0000000..80a33c5 --- /dev/null +++ b/.config/nvim/lua/plugins/airline.lua @@ -0,0 +1,13 @@ +-- Plugins that don't require any advanced config +return { + "vim-airline/vim-airline", + config = function() + vim.g["airline_theme"] = "bubblegum" + vim.g["airline#extensions#tabline#enabled"] = 1 + vim.g["airline_skip_empty_sections"] = 1 + vim.opt.showmode = false + end, + dependencies = { + {"vim-airline/vim-airline-themes"}, + }, +} diff --git a/.config/nvim/lua/plugins/catppuccin.lua b/.config/nvim/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..8d41bac --- /dev/null +++ b/.config/nvim/lua/plugins/catppuccin.lua @@ -0,0 +1,10 @@ +-- catppuccin colorscheme +-- https://github.com/catppuccin/nvim +return { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + config = function() + vim.cmd("colorscheme catppuccin-mocha") + end, +} diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..3c4b68b --- /dev/null +++ b/.config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,80 @@ +-- Completions with nvim-cmp and friends +-- https://github.com/hrsh7th/nvim-cmp + +local function configure_cmp() + + local cmp = require("cmp") + local cmp_types = require("cmp.types") + + local source_mapping = { + nvim_lsp = "[LSP]", + luasnip = "[LuaSnip]", + path = "[Path]", + buffer = "[Buffer]", + } + + cmp.setup({ + -- Expand snippets with cmp_luasnip + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + -- Keybindings + mapping = cmp.mapping.preset.insert({ + -- [""] = cmp.mapping(cmp.mapping.select_next_item({ behavior = cmp_types.cmp.SelectBehavior.Insert })), + -- This is to make the hotkey for both initiating completion and select next item + [""] = function(fallback) + if cmp.visible() then + cmp.select_next_item({ behavior = cmp_types.cmp.SelectBehavior.Insert }) + elseif (function() + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end)() then + cmp.complete() + else + fallback() + end + end, + [""] = cmp.mapping.select_prev_item({ behavior = cmp_types.cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.scroll_docs( 4), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.complete(), -- same as above + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = false }), + }), + -- TODO: Why are these separate? Priority? + sources = cmp.config.sources( + { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "path" }, + }, { + { name = "buffer" }, + } + ), + completion = { + keyword_length = 4, + completeopt = "menu,menuone,noselect", + }, + formatting = { + format = function(entry, vim_item) + vim_item.menu = source_mapping[entry.source.name] + return vim_item + end, + }, + }) +end + +return { + "hrsh7th/nvim-cmp", + dependencies = { + {"hrsh7th/cmp-nvim-lsp"}, + {"hrsh7th/cmp-buffer"}, + {"hrsh7th/cmp-path"}, + -- Snippet engine(s) required for nvim-cmp (expands things from LS) + {"L3MON4D3/LuaSnip"}, + {"saadparwaiz1/cmp_luasnip"}, + }, + config = configure_cmp, +} diff --git a/.config/nvim/lua/plugins/copilot.lua b/.config/nvim/lua/plugins/copilot.lua new file mode 100644 index 0000000..28a4f57 --- /dev/null +++ b/.config/nvim/lua/plugins/copilot.lua @@ -0,0 +1,12 @@ +-- https://github.com/github/copilot.vim + +return { + "github/copilot.vim", + config = function() + vim.g.copilot_filetypes = { + ["*"] = false, + julia = true, + markdown = true, + } + end, +} diff --git a/.config/nvim/lua/plugins/fzf.lua b/.config/nvim/lua/plugins/fzf.lua new file mode 100644 index 0000000..da681e7 --- /dev/null +++ b/.config/nvim/lua/plugins/fzf.lua @@ -0,0 +1,16 @@ +-- fzf.vim, fzf +-- https://github.com/junegunn/fzf.vim +-- https://github.com/junegunn/fzf + +return { + "junegunn/fzf.vim", + commit = "1e054c1d075d87903647db9320116d360eb8b024", + config = function() + vim.keymap.set("n", "", ":Rg!") + -- TODO: Use vim.keymap.set + vim.cmd("nnoremap len(system('git rev-parse')) ? ':Files!' : ':GFiles!'") + end, + dependencies = { + {"junegunn/fzf", commit = "952b6af4454ed55626d78e3845c6b5b640ac831d"}, + }, +} diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..489f307 --- /dev/null +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,35 @@ +-- https://github.com/lewis6991/gitsigns.nvim + +local function configure_gitsigns() + local gitsigns = require("gitsigns") + gitsigns.setup({ + on_attach = function(bufnr) + local opts = {buffer = bufnr, silent = true} + -- Hunk navigation + for _, x in pairs({{key = "]c", dir = "next"}, {key = "[c", dir = "prev"}}) do + vim.keymap.set( + "n", x.key, + function() + if vim.wo.diff then + vim.cmd.normal({x.key, bang = true}) + else + gitsigns.nav_hunk(x.dir) + end + end, + opts + ) + end + -- Hunk actions + vim.keymap.set("n", "hs", gitsigns.stage_hunk) + vim.keymap.set("n", "hr", gitsigns.reset_hunk) + -- vim.keymap.set("v", "hs", function() gitsigns.stage_hunk {vim.fn.line("."), vim.fn.line("v")} end) + -- vim.keymap.set("v", "hr", function() gitsigns.reset_hunk {vim.fn.line("."), vim.fn.line("v")} end) + vim.keymap.set("n", "hp", gitsigns.preview_hunk) + end + }) +end + +return { + "lewis6991/gitsigns.nvim", + config = configure_gitsigns, +} diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..d4d6a3d --- /dev/null +++ b/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,17 @@ +-- Plugins that don't require any advanced config +return { + -- https://github.com/christoomey/vim-tmux-navigator + {"christoomey/vim-tmux-navigator"}, + -- https://github.com/JuliaEditorSupport/julia-vim + {"JuliaEditorSupport/julia-vim"}, + -- https://github.com/tpope/vim-commentary + {"tpope/vim-commentary"}, + -- https://github.com/tpope/vim-fugitive + {"tpope/vim-fugitive"}, + -- https://github.com/tpope/vim-rhubarb + {"tpope/vim-rhubarb"}, + -- https://github.com/nvim-lua/plenary.nvim + {"nvim-lua/plenary.nvim"}, + -- https://github.com/andythigpen/nvim-coverage + {"andythigpen/nvim-coverage"}, +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..db6fd74 --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,78 @@ +-- nvim-lspconfig, https://github.com/neovim/nvim-lspconfig + +-- Set LSP keymappings in on_attach (i.e. only in buffers with LSP active) +-- TODO: lspconfig recommend doing this in an LspAttach autocommand instead +local on_attach = function(client, bufnr) + local opts = { buffer = bufnr, silent = true } + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + vim.keymap.set("n", "lrn", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "lrr", vim.lsp.buf.references, opts) + vim.keymap.set("n", "lca", function() vim.lsp.buf.code_action({apply = true}) end, opts) + vim.keymap.set("n", "lqf", function() vim.lsp.buf.code_action({apply = true}) end, opts) + vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) + vim.keymap.set("v", "lfmt", function() vim.lsp.buf.format({timeout_ms = 1000000}) end, opts) +end + +-- Setup lspconfig: capabilities is passed to lspconfig.$server.setup +-- TODO: Why don't I have to make_client_capabilities and extend? +local capabilities = require("cmp_nvim_lsp").default_capabilities() + +local default_opts = { + on_attach = on_attach, + capabilities = capabilities, +} + +local servers = { + -- Rust LSP (rust_analyzer) + rust_analyzer = default_opts, + -- C/C++ LSP (clangd) + clangd = default_opts, + -- Go LSP (gopls) + gopls = default_opts, + -- YAML LSP (yaml-language-server) + yamlls = default_opts, + -- Ansible LSP (ansible-language-server) + ansiblels = default_opts, + -- Terraform LSP (terraform-ls) + terraformls = default_opts, + -- Julia LSP (LanguageServer.jl) + julials = vim.tbl_extend( + "force", + default_opts, + { + on_new_config = function(new_config, _) + local julia = vim.fn.expand("~/.julia/environments/nvim-lspconfig/bin/julia") + local REVISE_LANGUAGESERVER = false + if REVISE_LANGUAGESERVER then + new_config.cmd[5] = (new_config.cmd[5]):gsub("using LanguageServer", "using Revise; using LanguageServer; LanguageServer.USE_REVISE[] = true") + elseif require(lspconfig).util.path.is_file(julia) then + new_config.cmd[1] = julia + end + end, + -- This just adds dirname(fname) as a fallback (see nvim-lspconfig#1768). + root_dir = function(fname) + local util = require("lspconfig.util") + return util.root_pattern "Project.toml"(fname) or util.find_git_ancestor(fname) or + util.path.dirname(fname) + end, + on_attach = function(client, bufnr) + on_attach(client, bufnr) + -- Disable automatic formatexpr since the LS.jl formatter isn't so nice. + vim.bo[bufnr].formatexpr = "" + end, + } + ), +} + +local function configure_lsp() + lspconfig = require("lspconfig") + for name, opts in pairs(servers) do + lspconfig[name].setup(opts) + end +end + +return { + "neovim/nvim-lspconfig", + config = configure_lsp, +} diff --git a/.config/nvim/lua/plugins/nullls.lua b/.config/nvim/lua/plugins/nullls.lua new file mode 100644 index 0000000..1972798 --- /dev/null +++ b/.config/nvim/lua/plugins/nullls.lua @@ -0,0 +1,16 @@ +-- https://github.com/jose-elias-alvarez/null-ls.nvim +return { + "jose-elias-alvarez/null-ls.nvim", + dependencies = { + {"nvim-lua/plenary.nvim"}, + }, + config = function() + local null_ls = require("null-ls") + local opts = { + sources = { + null_ls.builtins.diagnostics.shellcheck, + }, + } + null_ls.setup(opts) + end, +} diff --git a/.config/nvim/lua/plugins/slime.lua b/.config/nvim/lua/plugins/slime.lua new file mode 100644 index 0000000..cb4f123 --- /dev/null +++ b/.config/nvim/lua/plugins/slime.lua @@ -0,0 +1,23 @@ +-- vim-slime, https://github.com/jpalardy/vim-slime + +-- This expands {last} to a fixed pane id. This is done in the override function +-- in order to delay the expansion until first usage instead of when Vim starts. +-- TODO: Luaify this? Define this as a lua function, register it to be called +-- from vimscript by the plugin? +vim.cmd([[ + function! SlimeOverrideConfig() + let l:last_pane_id = trim(system('tmux display -pt "{last}" "#{pane_id}"')) + let b:slime_config = {"socket_name": "default", "target_pane": l:last_pane_id} + endfunction +]] +) + +return { + "jpalardy/vim-slime", + config = function() + vim.g["slime_target"] = "tmux" + vim.g["slime_bracketed_paste"] = 1 + vim.keymap.set("n", "", "SlimeParagraphSend") + vim.keymap.set("x", "", "SlimeRegionSend") + end, +} diff --git a/.vimrc b/.vimrc deleted file mode 100644 index 94e2e83..0000000 --- a/.vimrc +++ /dev/null @@ -1,139 +0,0 @@ -call plug#begin('~/.vim/plugged') - - "Julia support - Plug 'JuliaEditorSupport/julia-vim' - - "fzf plugins - Plug 'junegunn/fzf' - Plug 'junegunn/fzf.vim' - - "Status/tabline - Plug 'vim-airline/vim-airline' - Plug 'vim-airline/vim-airline-themes' - - "Comment/out blocks of code - Plug 'tpope/vim-commentary' - - "Git plugin - Plug 'tpope/vim-fugitive' - Plug 'tpope/vim-rhubarb' - - " Send code to REPL - Plug 'jpalardy/vim-slime' - - " Seemless vim/tmux navigation - Plug 'christoomey/vim-tmux-navigator' - - if has('nvim') - " LSP helpers - Plug 'neovim/nvim-lspconfig' - " nvim-cmp and completion sources - Plug 'hrsh7th/cmp-nvim-lsp' - Plug 'hrsh7th/cmp-buffer' - Plug 'hrsh7th/cmp-path' - " Plug 'hrsh7th/cmp-cmdline' - Plug 'hrsh7th/nvim-cmp' - " Snippet engine required for nvim-cmp (expands things from LS) - Plug 'L3MON4D3/LuaSnip' - Plug 'saadparwaiz1/cmp_luasnip' - - " Git changes in the sign column - Plug 'lewis6991/gitsigns.nvim' - - " Code coverage in sign column - Plug 'nvim-lua/plenary.nvim' - Plug 'andythigpen/nvim-coverage' - - " null-ls - " Plug 'nvim-lua/plenary.nvim' - Plug 'jose-elias-alvarez/null-ls.nvim' - - " Catppuccin color themes - Plug 'catppuccin/nvim', { 'as': 'catppuccin' } - - " Github Copilot - Plug 'github/copilot.vim' - end - -call plug#end() - -" Catppuccin colorscheme with the mocha style -:colorscheme catppuccin-mocha -:set termguicolors - -"Line numbers -:set number relativenumber - -" Column guide -:set colorcolumn=93 -:highlight ColorColumn guibg='#1d2021' - -" Show trailing whitespace etc -:set list listchars=tab:>-,trail:-,nbsp:+ - -"Misc keymappings and configurations -:imap jk -:let mapleader = " " -:set tabstop=4 softtabstop=4 shiftwidth=4 expandtab smarttab autoindent "Nicer tab actions -"Highlight without moving -:nnoremap * *`` -"Easier fzf keybindings -:nnoremap :Rg! -:nnoremap (len(system('git rev-parse')) ? ':Files!' : ':GFiles!')."" -"More natural split directions -:set splitbelow -:set splitright -"Auto-resize splits when terminal window changes size (e.g. when splitting or -"zooming with tmux -:autocmd VimResized * wincmd = - -" Airline status bar -:let g:airline_theme='bubblegum' -":let g:airline_left_sep='' -":let g:airline_right_sep='' -:let g:airline#extensions#tabline#enabled = 1 -":let g:airline#extensions#tabline#left_sep='' -:let g:airline_skip_empty_sections = 1 -:set noshowmode " Already showed by airline - -"Keep some lines above/below cursor -:set scrolloff=10 - -" Disable mouse (default on since neovim 0.8) -:set mouse= - -"Use clipboard for everything (instead of */+ registers) -:set clipboard+=unnamedplus - -" vim-slime settings for use in tmux -:let g:slime_target="tmux" -:function SlimeOverrideConfig() -: " This expands {last} to a fixed pane id. This is done in the override function in -: " order to delay the expansion until first usage instead of when Vim starts. -: let l:last_pane_id = trim(system('tmux display -pt "{last}" "#{pane_id}"')) -: let b:slime_config = {"socket_name": "default", "target_pane": l:last_pane_id} -:endfunction -:let g:slime_bracketed_paste=1 -:nnoremap SlimeParagraphSend -:nnoremap SlimeParagraphSend -:xnoremap SlimeRegionSend -:xnoremap SlimeRegionSend - -" Configure Copilot and limit to certain filetypes -let g:copilot_filetypes = { - \ '*': v:false, - \ 'julia': v:true, - \ 'markdown': v:true, -\} - -" Save folds between sessions -augroup SaveFileView - autocmd! - au BufWinLeave *.* mkview - au BufWinEnter *.* silent! loadview -augroup END - -augroup FileTypeJulia - autocmd! - au FileType julia set textwidth=92 -augroup END