From 7993fef918dc0aba5157874463b36bba9995f3fa Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Tue, 19 Mar 2024 15:39:14 -0500 Subject: [PATCH] new: Added configs from all machines --- README.md | 7 +- .../custom-snippets}/tex.snippets | 0 init.lua => laptop/init.lua | 0 paq.lua => laptop/paq.lua | 1 + {plugin => laptop/plugin}/airline.vim | 0 {plugin => laptop/plugin}/autopairs.lua | 0 {plugin => laptop/plugin}/cmp.lua | 0 {plugin => laptop/plugin}/conform.lua | 0 {plugin => laptop/plugin}/lean.lua | 0 {plugin => laptop/plugin}/lspconfig.lua | 0 {plugin => laptop/plugin}/moonfly.lua | 0 {plugin => laptop/plugin}/pyright.lua | 0 {plugin => laptop/plugin}/rust.lua | 0 {plugin => laptop/plugin}/suda.vim | 0 {plugin => laptop/plugin}/vimtex.vim | 0 vimrc.vim => laptop/vimrc.vim | 0 server/init.lua | 13 ++++ server/paq.lua | 55 ++++++++++++++ server/plugin/airline.vim | 45 +++++++++++ server/plugin/cmp.lua | 61 +++++++++++++++ server/plugin/moonfly.lua | 26 +++++++ server/plugin/pyright.lua | 11 +++ server/plugin/suda.vim | 3 + server/vimrc.vim | 75 +++++++++++++++++++ vps/init.lua | 13 ++++ vps/paq.lua | 60 +++++++++++++++ vps/plugin/airline.vim | 45 +++++++++++ vps/plugin/cmp.lua | 61 +++++++++++++++ vps/plugin/moonfly.lua | 26 +++++++ vps/plugin/pyright.lua | 11 +++ vps/plugin/suda.vim | 3 + vps/vimrc.vim | 75 +++++++++++++++++++ 32 files changed, 590 insertions(+), 1 deletion(-) rename {custom-snippets => laptop/custom-snippets}/tex.snippets (100%) rename init.lua => laptop/init.lua (100%) rename paq.lua => laptop/paq.lua (98%) rename {plugin => laptop/plugin}/airline.vim (100%) rename {plugin => laptop/plugin}/autopairs.lua (100%) rename {plugin => laptop/plugin}/cmp.lua (100%) rename {plugin => laptop/plugin}/conform.lua (100%) rename {plugin => laptop/plugin}/lean.lua (100%) rename {plugin => laptop/plugin}/lspconfig.lua (100%) rename {plugin => laptop/plugin}/moonfly.lua (100%) rename {plugin => laptop/plugin}/pyright.lua (100%) rename {plugin => laptop/plugin}/rust.lua (100%) rename {plugin => laptop/plugin}/suda.vim (100%) rename {plugin => laptop/plugin}/vimtex.vim (100%) rename vimrc.vim => laptop/vimrc.vim (100%) create mode 100644 server/init.lua create mode 100644 server/paq.lua create mode 100644 server/plugin/airline.vim create mode 100644 server/plugin/cmp.lua create mode 100644 server/plugin/moonfly.lua create mode 100644 server/plugin/pyright.lua create mode 100644 server/plugin/suda.vim create mode 100644 server/vimrc.vim create mode 100644 vps/init.lua create mode 100644 vps/paq.lua create mode 100644 vps/plugin/airline.vim create mode 100644 vps/plugin/cmp.lua create mode 100644 vps/plugin/moonfly.lua create mode 100644 vps/plugin/pyright.lua create mode 100644 vps/plugin/suda.vim create mode 100644 vps/vimrc.vim diff --git a/README.md b/README.md index fd65d3e..437ffa7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # My NeoVim Config Files -This is basically a copy of my `$XDG_CONFIG_HOME/nvim`. Feel free to use it for configuring your [NeoVim](https://neovim.io/) installation the way you like it. +This is basically a collection of copies of `$XDG_CONFIG_HOME/nvim` from all my +machines. The `laptop` one is the most comprehensive, the others are basically +subsets of it. + +Feel free to use it for configuring your [NeoVim](https://neovim.io/) +installation the way you like it. [Link to the base repo.](https://git.sintan1729.uk/SinTan1729/my-nvim-config) diff --git a/custom-snippets/tex.snippets b/laptop/custom-snippets/tex.snippets similarity index 100% rename from custom-snippets/tex.snippets rename to laptop/custom-snippets/tex.snippets diff --git a/init.lua b/laptop/init.lua similarity index 100% rename from init.lua rename to laptop/init.lua diff --git a/paq.lua b/laptop/paq.lua similarity index 98% rename from paq.lua rename to laptop/paq.lua index 1278705..3fe3b9b 100644 --- a/paq.lua +++ b/laptop/paq.lua @@ -22,6 +22,7 @@ end -- Load plugin via paq-nvim bootstrap_paq { + -- Let paq-nvim manage itself "savq/paq-nvim", -- airline related plugins "vim-airline/vim-airline", diff --git a/plugin/airline.vim b/laptop/plugin/airline.vim similarity index 100% rename from plugin/airline.vim rename to laptop/plugin/airline.vim diff --git a/plugin/autopairs.lua b/laptop/plugin/autopairs.lua similarity index 100% rename from plugin/autopairs.lua rename to laptop/plugin/autopairs.lua diff --git a/plugin/cmp.lua b/laptop/plugin/cmp.lua similarity index 100% rename from plugin/cmp.lua rename to laptop/plugin/cmp.lua diff --git a/plugin/conform.lua b/laptop/plugin/conform.lua similarity index 100% rename from plugin/conform.lua rename to laptop/plugin/conform.lua diff --git a/plugin/lean.lua b/laptop/plugin/lean.lua similarity index 100% rename from plugin/lean.lua rename to laptop/plugin/lean.lua diff --git a/plugin/lspconfig.lua b/laptop/plugin/lspconfig.lua similarity index 100% rename from plugin/lspconfig.lua rename to laptop/plugin/lspconfig.lua diff --git a/plugin/moonfly.lua b/laptop/plugin/moonfly.lua similarity index 100% rename from plugin/moonfly.lua rename to laptop/plugin/moonfly.lua diff --git a/plugin/pyright.lua b/laptop/plugin/pyright.lua similarity index 100% rename from plugin/pyright.lua rename to laptop/plugin/pyright.lua diff --git a/plugin/rust.lua b/laptop/plugin/rust.lua similarity index 100% rename from plugin/rust.lua rename to laptop/plugin/rust.lua diff --git a/plugin/suda.vim b/laptop/plugin/suda.vim similarity index 100% rename from plugin/suda.vim rename to laptop/plugin/suda.vim diff --git a/plugin/vimtex.vim b/laptop/plugin/vimtex.vim similarity index 100% rename from plugin/vimtex.vim rename to laptop/plugin/vimtex.vim diff --git a/vimrc.vim b/laptop/vimrc.vim similarity index 100% rename from vimrc.vim rename to laptop/vimrc.vim diff --git a/server/init.lua b/server/init.lua new file mode 100644 index 0000000..1d71c09 --- /dev/null +++ b/server/init.lua @@ -0,0 +1,13 @@ +-- Load old vimrc first +local vimrc = vim.fn.stdpath("config") .. "/vimrc.vim" +vim.cmd.source(vimrc) + +-- Load plugins using paq-nvim +local paq = vim.fn.stdpath("config") .. "/paq.lua" +vim.cmd.source(paq) + +-- Default settings for comment plugin +require('Comment').setup() + +-- Default settings for autopairs plugin +require('nvim-autopairs').setup() diff --git a/server/paq.lua b/server/paq.lua new file mode 100644 index 0000000..5e8e964 --- /dev/null +++ b/server/paq.lua @@ -0,0 +1,55 @@ +-- Automatically bootstrap paq-nvim +local function clone_paq() + local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim" + local is_installed = vim.fn.empty(vim.fn.glob(path)) == 0 + if not is_installed then + vim.fn.system { "git", "clone", "--depth=1", "https://github.com/savq/paq-nvim.git", path } + return true + end +end + +-- Automatically install new packages at startup +local function bootstrap_paq(packages) + local first_install = clone_paq() + vim.cmd.packadd("paq-nvim") + local paq = require("paq") + paq(packages) + if first_install then + vim.notify("Installing plugins... If prompted, hit Enter to continue.") + paq.install() + end +end + +-- Load plugins via paq-nvim +bootstrap_paq { + -- Let paq-nvim manage itself + "savq/paq-nvim", + -- airline related plugins + "vim-airline/vim-airline", + "vim-airline/vim-airline-themes", + -- Auto commenting per filetype + "numToStr/Comment.nvim", + -- Give option to save files using sudo, if needed + "lambdalisue/suda.vim", + -- Auto toggle for number mode when vim isn't focused + "sitiom/nvim-numbertoggle", + -- LSP related plugins + "neovim/nvim-lspconfig", + "nvim-lua/plenary.nvim", + "hrsh7th/nvim-cmp", -- For LSP completion + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + -- Support programming terms + { "psliwka/vim-dirtytalk", build = ':let &rtp = &rtp | DirtytalkUpdate' }, + -- vim-moonfly theme + { "bluz71/vim-moonfly-colors", as = 'moonfly' }, + -- Automatically add bracket pairs + "windwp/nvim-autopairs", + -- Syntax highlighting for Caddyfile + "isobit/vim-caddyfile", + -- Syntax highlighting for Fish scripts + "khaveesh/vim-fish-syntax", +} + diff --git a/server/plugin/airline.vim b/server/plugin/airline.vim new file mode 100644 index 0000000..b295121 --- /dev/null +++ b/server/plugin/airline.vim @@ -0,0 +1,45 @@ +" enable tabline +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#tabline#left_sep = '' +let g:airline#extensions#tabline#left_alt_sep = '' +let g:airline#extensions#tabline#right_sep = '' +let g:airline#extensions#tabline#right_alt_sep = '' + +" air-line +let g:airline_powerline_fonts = 1 + +if !exists('g:airline_symbols') + let g:airline_symbols = {} +endif + +" unicode symbols +let g:airline_left_sep = '»' +let g:airline_left_sep = '▶' +let g:airline_right_sep = '«' +let g:airline_right_sep = '◀' +let g:airline_symbols.linenr = '␊' +let g:airline_symbols.linenr = '␤' +let g:airline_symbols.linenr = '¶' +let g:airline_symbols.branch = '⎇' +let g:airline_symbols.paste = 'ρ' +let g:airline_symbols.paste = 'Þ' +let g:airline_symbols.paste = '∥' +let g:airline_symbols.whitespace = 'Ξ' + +" airline symbols +let g:airline_left_sep = '' +let g:airline_left_alt_sep = '' +let g:airline_right_sep = '' +let g:airline_right_alt_sep = '' +let g:airline_symbols.branch = '' +let g:airline_symbols.readonly = '' +let g:airline_symbols.linenr = '' + +" Switch to your current theme +let g:airline_theme = 'moonfly' + +" Always show tabs +set showtabline=2 + +" We don't need to see things like -- INSERT -- anymore +set noshowmode diff --git a/server/plugin/cmp.lua b/server/plugin/cmp.lua new file mode 100644 index 0000000..34ba86c --- /dev/null +++ b/server/plugin/cmp.lua @@ -0,0 +1,61 @@ +local cmp = require'cmp' + +cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + -- require('snippy').expand_snippet(args.body) -- For `snippy` users. + -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. + end, + }, + window = { + completion = cmp.config.window.bordered(winhighlight), + documentation = cmp.config.window.bordered(winhighlight), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, -- For vsnip users. + -- { name = 'luasnip' }, -- For luasnip users. + -- { name = 'ultisnips' }, -- For ultisnips users. + -- { name = 'snippy' }, -- For snippy users. + }, {{ name = 'buffer' }} + ), + experimental = { ghost_text = true }, + }) + + -- Set configuration for specific filetype. + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). + }, { + { name = 'buffer' }, + }) +}) + +-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline({ '/', '?' }, { +mapping = cmp.mapping.preset.cmdline(), +sources = { + { name = 'buffer' } +} +}) + +-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline(':', { +mapping = cmp.mapping.preset.cmdline(), +sources = cmp.config.sources({ + { name = 'path' } +}, { + { name = 'cmdline' } +}) +}) + diff --git a/server/plugin/moonfly.lua b/server/plugin/moonfly.lua new file mode 100644 index 0000000..670df16 --- /dev/null +++ b/server/plugin/moonfly.lua @@ -0,0 +1,26 @@ +-- Use moonfly colors in popups +vim.g.moonflyNormalFloat = true + +-- Extra setup to distinguish between edit and floating windows +vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = "single" + } +) +vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with( + vim.lsp.handlers.signatureHelp, { + border = "single" + } +) +vim.diagnostic.config({ float = { border = "single" } }) +-- Some more setup is inside cmp.lua + +-- Make the background transparent +vim.g.moonflyTransparent = true + +-- Display diagnostic virtual text in color +vim.g.moonflyVirtualTextColor = true + +-- Use the moonfly colorscheme +vim.cmd [[colorscheme moonfly]] + diff --git a/server/plugin/pyright.lua b/server/plugin/pyright.lua new file mode 100644 index 0000000..132e859 --- /dev/null +++ b/server/plugin/pyright.lua @@ -0,0 +1,11 @@ +require'lspconfig'.pyright.setup({ + on_attach = on_attach, + flags = lsp_flags, + settings = { + python = { + analysis = { + typeCheckingMode = "off" + } + } + } +}) diff --git a/server/plugin/suda.vim b/server/plugin/suda.vim new file mode 100644 index 0000000..d66021d --- /dev/null +++ b/server/plugin/suda.vim @@ -0,0 +1,3 @@ +if ! &diff + let g:suda_smart_edit = 1 +endif diff --git a/server/vimrc.vim b/server/vimrc.vim new file mode 100644 index 0000000..5addd91 --- /dev/null +++ b/server/vimrc.vim @@ -0,0 +1,75 @@ +" Disable netrw for nvim-tree to work +let loaded_netrw = 1 +let loaded_netrwPlugin = 1 + +" Turn on numbers +set number + +" Turn off line wrapping +set nowrap + +" Turn on syntax highlighting +syntax on +filetype plugin indent on + +" Disable cmdline from bottom +set cmdheight=0 + +" Display as much of a line as possible instead of just showing @ +set display+=lastline + +" Ignore case while searching except when the search term contains capital +" letters +set ignorecase +set smartcase + +" Use 4 spaces for tabs and properly adjust them for files using TAB +set tabstop=4 +set shiftwidth=4 +set expandtab + +" Needed for group colors to work in nvim-tree +set termguicolors + +" Show LSP signs in the number column +set signcolumn=number + +" Turn on spell checking +set spell + +" Enable mouse support +set mouse=n + +" Enable automatic format on save, text change in normal mode and leaving +" insert mode +autocmd BufWritePre,TextChanged,InsertLeave lua vim.lsp.buf.format() + +" Set K to hover +command -nargs=+ LspHover lua vim.lsp.buf.hover() +set keywordprg=:LspHover + +" Enable programming dictionary +set spelllang=en,programming + +" Disable unused plugins +let g:loaded_perl_provider=0 +let g:loaded_node_provider=0 +let g:loaded_ruby_provider=0 + +" Change the leader to a comma +let mapleader = "," +let g:mapleader = "," + +" Use ,dd for deleting without putting into buffer +nnoremap d "_d +nnoremap D "_D +nnoremap x "_x +vnoremap d "_d + +" Insert a newline in normal mode by ,o +nnoremap o ok +nnoremap O Oj + +" Use ,u for redo +nnoremap u + diff --git a/vps/init.lua b/vps/init.lua new file mode 100644 index 0000000..1d71c09 --- /dev/null +++ b/vps/init.lua @@ -0,0 +1,13 @@ +-- Load old vimrc first +local vimrc = vim.fn.stdpath("config") .. "/vimrc.vim" +vim.cmd.source(vimrc) + +-- Load plugins using paq-nvim +local paq = vim.fn.stdpath("config") .. "/paq.lua" +vim.cmd.source(paq) + +-- Default settings for comment plugin +require('Comment').setup() + +-- Default settings for autopairs plugin +require('nvim-autopairs').setup() diff --git a/vps/paq.lua b/vps/paq.lua new file mode 100644 index 0000000..aed3482 --- /dev/null +++ b/vps/paq.lua @@ -0,0 +1,60 @@ +-- Automatically bootstrap paq-nvim +local function clone_paq() + local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim" + local is_installed = vim.fn.empty(vim.fn.glob(path)) == 0 + if not is_installed then + vim.fn.system { "git", "clone", "--depth=1", "https://github.com/savq/paq-nvim.git", path } + return true + end +end + +-- Automatically install new packages at startup +local function bootstrap_paq(packages) + local first_install = clone_paq() + vim.cmd.packadd("paq-nvim") + local paq = require("paq") + paq(packages) + if first_install then + vim.notify("Installing plugins... If prompted, hit Enter to continue.") + paq.install() + end +end + +-- Load plugins via paq-nvim +bootstrap_paq { + -- Let paq-nvim manage itself + "savq/paq-nvim", + -- airline related plugins + "vim-airline/vim-airline", + "vim-airline/vim-airline-themes", + -- Auto commenting per filetype + "numToStr/Comment.nvim", + -- Give option to save files using sudo, if needed + "lambdalisue/suda.vim", + -- Auto toggle for number mode when vim isn't focused + "sitiom/nvim-numbertoggle", + -- Plugin for lean + "nvim-tree/nvim-tree.lua", + "nvim-tree/nvim-web-devicons", + -- LSP related plugins + "neovim/nvim-lspconfig", + "nvim-lua/plenary.nvim", + "hrsh7th/nvim-cmp", -- For LSP completion + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-vsnip", -- For snippets + "hrsh7th/vim-vsnip", -- For snippets + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + -- Support programming terms + { "psliwka/vim-dirtytalk", build = ':let &rtp = &rtp | DirtytalkUpdate' }, + -- vim-moonfly theme + { "bluz71/vim-moonfly-colors", as = 'moonfly' }, + -- Automatically add bracket pairs + "windwp/nvim-autopairs", + -- Syntax highlighting for Caddyfile + "isobit/vim-caddyfile", + -- Syntax highlighting for Fish scripts + "khaveesh/vim-fish-syntax", +} + diff --git a/vps/plugin/airline.vim b/vps/plugin/airline.vim new file mode 100644 index 0000000..b295121 --- /dev/null +++ b/vps/plugin/airline.vim @@ -0,0 +1,45 @@ +" enable tabline +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#tabline#left_sep = '' +let g:airline#extensions#tabline#left_alt_sep = '' +let g:airline#extensions#tabline#right_sep = '' +let g:airline#extensions#tabline#right_alt_sep = '' + +" air-line +let g:airline_powerline_fonts = 1 + +if !exists('g:airline_symbols') + let g:airline_symbols = {} +endif + +" unicode symbols +let g:airline_left_sep = '»' +let g:airline_left_sep = '▶' +let g:airline_right_sep = '«' +let g:airline_right_sep = '◀' +let g:airline_symbols.linenr = '␊' +let g:airline_symbols.linenr = '␤' +let g:airline_symbols.linenr = '¶' +let g:airline_symbols.branch = '⎇' +let g:airline_symbols.paste = 'ρ' +let g:airline_symbols.paste = 'Þ' +let g:airline_symbols.paste = '∥' +let g:airline_symbols.whitespace = 'Ξ' + +" airline symbols +let g:airline_left_sep = '' +let g:airline_left_alt_sep = '' +let g:airline_right_sep = '' +let g:airline_right_alt_sep = '' +let g:airline_symbols.branch = '' +let g:airline_symbols.readonly = '' +let g:airline_symbols.linenr = '' + +" Switch to your current theme +let g:airline_theme = 'moonfly' + +" Always show tabs +set showtabline=2 + +" We don't need to see things like -- INSERT -- anymore +set noshowmode diff --git a/vps/plugin/cmp.lua b/vps/plugin/cmp.lua new file mode 100644 index 0000000..34ba86c --- /dev/null +++ b/vps/plugin/cmp.lua @@ -0,0 +1,61 @@ +local cmp = require'cmp' + +cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + -- require('snippy').expand_snippet(args.body) -- For `snippy` users. + -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. + end, + }, + window = { + completion = cmp.config.window.bordered(winhighlight), + documentation = cmp.config.window.bordered(winhighlight), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, -- For vsnip users. + -- { name = 'luasnip' }, -- For luasnip users. + -- { name = 'ultisnips' }, -- For ultisnips users. + -- { name = 'snippy' }, -- For snippy users. + }, {{ name = 'buffer' }} + ), + experimental = { ghost_text = true }, + }) + + -- Set configuration for specific filetype. + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). + }, { + { name = 'buffer' }, + }) +}) + +-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline({ '/', '?' }, { +mapping = cmp.mapping.preset.cmdline(), +sources = { + { name = 'buffer' } +} +}) + +-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline(':', { +mapping = cmp.mapping.preset.cmdline(), +sources = cmp.config.sources({ + { name = 'path' } +}, { + { name = 'cmdline' } +}) +}) + diff --git a/vps/plugin/moonfly.lua b/vps/plugin/moonfly.lua new file mode 100644 index 0000000..670df16 --- /dev/null +++ b/vps/plugin/moonfly.lua @@ -0,0 +1,26 @@ +-- Use moonfly colors in popups +vim.g.moonflyNormalFloat = true + +-- Extra setup to distinguish between edit and floating windows +vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = "single" + } +) +vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with( + vim.lsp.handlers.signatureHelp, { + border = "single" + } +) +vim.diagnostic.config({ float = { border = "single" } }) +-- Some more setup is inside cmp.lua + +-- Make the background transparent +vim.g.moonflyTransparent = true + +-- Display diagnostic virtual text in color +vim.g.moonflyVirtualTextColor = true + +-- Use the moonfly colorscheme +vim.cmd [[colorscheme moonfly]] + diff --git a/vps/plugin/pyright.lua b/vps/plugin/pyright.lua new file mode 100644 index 0000000..132e859 --- /dev/null +++ b/vps/plugin/pyright.lua @@ -0,0 +1,11 @@ +require'lspconfig'.pyright.setup({ + on_attach = on_attach, + flags = lsp_flags, + settings = { + python = { + analysis = { + typeCheckingMode = "off" + } + } + } +}) diff --git a/vps/plugin/suda.vim b/vps/plugin/suda.vim new file mode 100644 index 0000000..d66021d --- /dev/null +++ b/vps/plugin/suda.vim @@ -0,0 +1,3 @@ +if ! &diff + let g:suda_smart_edit = 1 +endif diff --git a/vps/vimrc.vim b/vps/vimrc.vim new file mode 100644 index 0000000..5addd91 --- /dev/null +++ b/vps/vimrc.vim @@ -0,0 +1,75 @@ +" Disable netrw for nvim-tree to work +let loaded_netrw = 1 +let loaded_netrwPlugin = 1 + +" Turn on numbers +set number + +" Turn off line wrapping +set nowrap + +" Turn on syntax highlighting +syntax on +filetype plugin indent on + +" Disable cmdline from bottom +set cmdheight=0 + +" Display as much of a line as possible instead of just showing @ +set display+=lastline + +" Ignore case while searching except when the search term contains capital +" letters +set ignorecase +set smartcase + +" Use 4 spaces for tabs and properly adjust them for files using TAB +set tabstop=4 +set shiftwidth=4 +set expandtab + +" Needed for group colors to work in nvim-tree +set termguicolors + +" Show LSP signs in the number column +set signcolumn=number + +" Turn on spell checking +set spell + +" Enable mouse support +set mouse=n + +" Enable automatic format on save, text change in normal mode and leaving +" insert mode +autocmd BufWritePre,TextChanged,InsertLeave lua vim.lsp.buf.format() + +" Set K to hover +command -nargs=+ LspHover lua vim.lsp.buf.hover() +set keywordprg=:LspHover + +" Enable programming dictionary +set spelllang=en,programming + +" Disable unused plugins +let g:loaded_perl_provider=0 +let g:loaded_node_provider=0 +let g:loaded_ruby_provider=0 + +" Change the leader to a comma +let mapleader = "," +let g:mapleader = "," + +" Use ,dd for deleting without putting into buffer +nnoremap d "_d +nnoremap D "_D +nnoremap x "_x +vnoremap d "_d + +" Insert a newline in normal mode by ,o +nnoremap o ok +nnoremap O Oj + +" Use ,u for redo +nnoremap u +