diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 9c88f36..08954f3 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -11,16 +11,37 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) +-- coq used for completion +vim.g.coq_settings = { + auto_start = true, + xdg = true, + completion = { + always = false, + }, + keymap = { + manual_complete = '', + } +} + +-- code completion require('lazy').setup('plugins') +local coq = require 'coq' +require("mason").setup() -- used for automatically enabling lsp and coq +require("mason-lspconfig").setup() + + + -- Settings vim.cmd('source ~/.config/nvim/settings.vim') + + -- colorscheme vim.o.termguicolors = true -vim.o.background = "dark" -- or "light" for light mode +--vim.o.background = "dark" -- or "light" for light mode --vim.cmd("colorscheme gruvbox ") -vim.cmd("colorscheme retrobox") +--vim.cmd("colorscheme retrobox") -- keymaps vim.keymap.set('n', '/', ':nohlsearch') diff --git a/.config/nvim/lua/plugins/vim-arsync.lua b/.config/nvim/lua/plugins/arsync.lua similarity index 100% rename from .config/nvim/lua/plugins/vim-arsync.lua rename to .config/nvim/lua/plugins/arsync.lua diff --git a/.config/nvim/lua/plugins/auto-save.lua b/.config/nvim/lua/plugins/auto-save.lua index 7ff9307..2ae9941 100644 --- a/.config/nvim/lua/plugins/auto-save.lua +++ b/.config/nvim/lua/plugins/auto-save.lua @@ -1,11 +1,19 @@ return{ "okuuva/auto-save.nvim", - version = '^1.0.0', -- see https://devhints.io/semver, alternatively use '*' to use the latest tagged release + --version = '*', -- see https://devhints.io/semver, alternatively use '*' to use the latest tagged release cmd = "ASToggle", -- optional for lazy loading on command + execution_message = { + message = function() -- message to print on save + return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S")) + end, + dim = 0.18, -- dim the color of `message` + cleaning_interval = 1250, -- (milliseconds) automatically clean MsgArea after displaying `message`. See :h MsgArea + }, event = { "InsertLeave", "TextChanged" }, -- optional for lazy loading on trigger events opts = { -- your config goes here -- or just leave it empty :) - enabled = false + enabled = false, + debug = true, }, } diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..83a3127 --- /dev/null +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,13 @@ +return { + "metalelf0/black-metal-theme-neovim", + lazy = false, + priority = 1000, + config = function() + require("black-metal").setup({ + -- optional configuration here + term_colors = true, + }) + + require("black-metal").load() + end, +} diff --git a/.config/nvim/lua/plugins/copilot.lua b/.config/nvim/lua/plugins/copilot.lua new file mode 100644 index 0000000..3e92ab6 --- /dev/null +++ b/.config/nvim/lua/plugins/copilot.lua @@ -0,0 +1,12 @@ +return { + 'github/copilot.vim', + config = function() + vim.keymap.set('i', '', 'copilot#Accept("\\")', { + expr = true, + replace_keycodes = false + }) + vim.keymap.set('i', '', '(copilot-accept-word)') + vim.g.copilot_enabled = 'v:false' + end +} + diff --git a/.config/nvim/lua/plugins/gruvbox.lua b/.config/nvim/lua/plugins/gruvbox.lua deleted file mode 100644 index 4fa0e95..0000000 --- a/.config/nvim/lua/plugins/gruvbox.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - "ellisonleao/gruvbox.nvim", - priority = 1000, - config = function () - require("gruvbox").setup({ - undercurl = true, - underline = true, - bold = true, - italic = { - strings = true, - comments = true, - operators = false, - folds = true, - }, - strikethrough = true, - invert_selection = false, - invert_signs = false, - invert_tabline = false, - invert_intend_guides = false, - inverse = true, -- invert background for search, diffs, statuslines and errors - contrast = "hard", -- can be "hard", "soft" or empty string - palette_overrides = {}, - overrides = {}, - dim_inactive = false, - transparent_mode = true, - }) - end -} - diff --git a/.config/nvim/lua/plugins/lsp-config.lua b/.config/nvim/lua/plugins/lsp-config.lua new file mode 100644 index 0000000..2dfba42 --- /dev/null +++ b/.config/nvim/lua/plugins/lsp-config.lua @@ -0,0 +1,10 @@ +return { + "mason-org/mason-lspconfig.nvim", + dependencies = { + "mason-org/mason.nvim", + "neovim/nvim-lspconfig", + "ms-jpq/coq_nvim", -- Optional (auto complete) + }, + condig = function() + end +} diff --git a/.config/nvim/lua/plugins/lsp-zero.lua b/.config/nvim/lua/plugins/lsp-zero.lua deleted file mode 100644 index 103f0f9..0000000 --- a/.config/nvim/lua/plugins/lsp-zero.lua +++ /dev/null @@ -1,80 +0,0 @@ -return { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v2.x', - dependencies = { - -- LSP Support - { 'neovim/nvim-lspconfig' }, -- Required - { 'williamboman/mason.nvim' }, -- Optional - { 'williamboman/mason-lspconfig.nvim' }, -- Optional - - -- Autocompletion - { 'hrsh7th/nvim-cmp' }, -- Required - { 'hrsh7th/cmp-nvim-lsp' }, -- Required - { 'hrsh7th/cmp-buffer' }, -- Optional - { 'hrsh7th/cmp-path' }, -- Optional - { 'saadparwaiz1/cmp_luasnip' }, -- Optional - { 'hrsh7th/cmp-nvim-lua' }, -- Optional - - - -- snippets - { 'L3MON4D3/LuaSnip' }, -- Required - { 'rafamadriz/friendly-snippets' }, -- Optional - }, - - config = function() - local lsp = require('lsp-zero') - lsp.preset('recommended') - - lsp.on_attach(function(client, bufnr) - local opts = { buffer = bufnr, remap = false } - - vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) - vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) - vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) - vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) - vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) - vim.keymap.set("n", "ca", function() vim.lsp.buf.code_action() end, opts) - vim.keymap.set("n", "rr", function() vim.lsp.buf.references() end, opts) - vim.keymap.set("n", "rn", function() vim.lsp.buf.rename() end, opts) - vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) - end) - - local lspconfig = require('lspconfig') - local root_pattern = require('lspconfig.util').root_pattern - - lspconfig['jedi_language_server'].setup { - root_dir = root_pattern('.git', 'setup.py') - } - - lspconfig['lua_ls'].setup { - settings = { - Lua = { - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { 'vim' }, - }, - }, - }, - } - - local cmp = require('cmp') - local cmp_action = require('lsp-zero').cmp_action() - require('luasnip.loaders.from_vscode').lazy_load() - - cmp.setup({ - mapping = { - [''] = cmp.mapping.confirm({ select = false }), - [''] = cmp_action.luasnip_jump_forward(), - [''] = cmp_action.luasnip_jump_backward(), - }, - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end - }, - }) - - lsp.setup() - end -} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index a633dd9..c6dd481 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -1,46 +1,46 @@ return{ - 'nvim-lualine/lualine.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons', opt = true }, - config = function() - require('lualine').setup { - 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 = {'branch', 'diff', 'diagnostics'}, - lualine_c = {'filename'}, - lualine_x = {'encoding', 'fileformat', 'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} - } - end + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons', opt = true }, + config = function() + require('lualine').setup { + 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 = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} + } + end } diff --git a/.config/nvim/lua/plugins/render-makdown.lua b/.config/nvim/lua/plugins/render-makdown.lua index 6a5a30a..8001d6c 100644 --- a/.config/nvim/lua/plugins/render-makdown.lua +++ b/.config/nvim/lua/plugins/render-makdown.lua @@ -5,25 +5,22 @@ return { -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons ---@module 'render-markdown' ---@type render.md.UserConfig - opts = {}, - - config = function() - require('render-markdown').setup({ + opts = { + completions = { lsp = { enabled = true } }, render_modes = true, heading = { width = 'block', - min_width = 81, + min_width = 80, }, - - indent = { + code = { + disable_background = { 'diff' }, + }, + indent = { enabled = true, skip_heading = true, }, - sign = { enabled = true, }, - - }) - end + }, } diff --git a/.config/nvim/lua/plugins/vim-copilot.lua b/.config/nvim/lua/plugins/vim-copilot.lua deleted file mode 100644 index 55dc633..0000000 --- a/.config/nvim/lua/plugins/vim-copilot.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - 'github/copilot.vim', - config = function() - vim.keymap.set('i', '', 'copilot#Accept("\\")', { - expr = true, - replace_keycodes = false - }) - vim.g.copilot_no_tab_map = true - end -} - diff --git a/.config/nvim/lua/plugins/zen-mode.lua b/.config/nvim/lua/plugins/zen-mode.lua new file mode 100644 index 0000000..ad5fa76 --- /dev/null +++ b/.config/nvim/lua/plugins/zen-mode.lua @@ -0,0 +1,11 @@ +return { + "folke/zen-mode.nvim", + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + window = { + width = 90, -- width of the Zen window + } + } +} diff --git a/.config/nvim/settings.vim b/.config/nvim/settings.vim index b1dbc66..e3d7b50 100644 --- a/.config/nvim/settings.vim +++ b/.config/nvim/settings.vim @@ -17,28 +17,26 @@ set showmatch set ruler set wrap set showbreak=↳\ \ -set textwidth=79 set hidden set backspace=indent,eol,start set hlsearch set noswapfile set mouse= "remove mouse -set clipboard=unnamedplus +"set clipboard=unnamedplus " Rendering set ttyfast set laststatus=1 set t_Co=256 -set background=dark let &t_ut='' set colorcolumn=81 -hi ColorColumn ctermbg=lightgrey guibg=lightgrey +"hi ColorColumn ctermbg=lightgrey guibg=lightgrey " Show bad whitespace in an obvious but not obnoxious color -highlight pythonSpaceError ctermbg=darkgreen guibg=darkgreen -highlight BadWhitespace ctermbg=darkgreen guibg=darkgreen -au BufNewFile,BufRead *.py,*.pyw,*.c,*.h,*.cc,*.hh,*.sh match BadWhitespace /\s\+$/ +"highlight pythonSpaceError ctermbg=darkgreen guibg=darkgreen +"highlight BadWhitespace ctermbg=darkgreen guibg=darkgreen +"au BufNewFile,BufRead *.py,*.pyw,*.c,*.h,*.cc,*.hh,*.sh match BadWhitespace /\s\+$/ " File settings au FileType * @@ -52,14 +50,8 @@ au FileType * "Python Specific Config au FileType python \ set fileformat=unix - \ tabstop=4 - \ softtabstop=4 - \ shiftwidth=4 \ encoding=utf-8 au FileType markdown,tex - \ set spell spelllang=en_us - \ tabstop=4 - \ softtabstop=4 - \ shiftwidth=4 + \ set spell spelllang=en_us