diff options
-rw-r--r-- | after/plugin/cfg.vim | 2 | ||||
-rw-r--r-- | after/plugin/fzf-lua.lua | 2 | ||||
-rw-r--r-- | after/plugin/lsp.lua | 47 | ||||
-rw-r--r-- | colors/monochrome.vim | 182 | ||||
-rw-r--r-- | init.lua | 30 |
5 files changed, 237 insertions, 26 deletions
diff --git a/after/plugin/cfg.vim b/after/plugin/cfg.vim index 1527a6f..c71ccb1 100644 --- a/after/plugin/cfg.vim +++ b/after/plugin/cfg.vim @@ -3,4 +3,4 @@ set autoindent set sw=4 ts=4 noet tw=80 cc=80 set spr sb pb=12 winbl=12 nowrap ruler autoread set gfn=Hack:h10 noshowmode -color oxocarbon +colorscheme monochrome diff --git a/after/plugin/fzf-lua.lua b/after/plugin/fzf-lua.lua index d687fda..69e0742 100644 --- a/after/plugin/fzf-lua.lua +++ b/after/plugin/fzf-lua.lua @@ -1,2 +1,4 @@ +require('util').nn('<leader>b', '<cmd>FzfLua buffers<CR>') +require('util').nn('<leader>fs', '<cmd>FzfLua lsp_workspace_symbols<CR>') require('util').nn('<leader>ff', '<cmd>FzfLua files<CR>') diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 3f790d7..64cae8f 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -53,27 +53,32 @@ cmp.setup.cmdline(':', { matching = { disallow_symbol_nonprefix_matching = false } }) -local function onattach(client, buf) - nn("gD", vim.lsp.buf.declaration) - nn("gd", vim.lsp.buf.definition) - nn("<Leader>K", vim.lsp.buf.hover) - nn("gi", vim.lsp.buf.implementation) - nn("<C-k>", vim.lsp.buf.signature_help) - nn("<Leader>D", vim.lsp.buf.type_definition) - nn("<Leader>r", vim.lsp.buf.rename) - nn("<Leader>A", vim.lsp.buf.code_action) - nn("<Leader>R", vim.lsp.buf.references) - nn("<Leader>f", vim.lsp.buf.format) -end - -local caps = vim.lsp.protocol.make_client_capabilities() -caps = cmp_lsp.default_capabilities(caps) +vim.api.nvim_create_autocmd('LspAttach', { + callback = function(args) + nn("gD", vim.lsp.buf.declaration) + nn("gd", vim.lsp.buf.definition) + nn("<Leader>K", vim.lsp.buf.hover) + nn("gi", vim.lsp.buf.implementation) + nn("<C-k>", vim.lsp.buf.signature_help) + nn("<Leader>D", vim.lsp.buf.type_definition) + nn("<Leader>r", vim.lsp.buf.rename) + nn("<Leader>A", vim.lsp.buf.code_action) + nn("<Leader>R", vim.lsp.buf.references) + nn("<Leader>f", vim.lsp.buf.format) + end, +}) -local servers = {'clangd', 'rust_analyzer', 'zls', 'texlab', 'biome'} +local servers = {'clangd', 'rust_analyzer', 'zls', 'texlab', 'biome', 'tinymist'} for _, lsp in pairs(servers) do - lspconfig[lsp].setup { - capabilities = caps, - on_attach = onattach, - flags = { debounce_text_changes = 500 } - } + vim.lsp.enable(lsp) end + +vim.diagnostic.config({ + virtual_text = false, + virtual_lines = true, + signs = true, + update_in_insert = false, + underline = true, + severity_sort = false, + float = true, +}) diff --git a/colors/monochrome.vim b/colors/monochrome.vim new file mode 100644 index 0000000..fc58c5c --- /dev/null +++ b/colors/monochrome.vim @@ -0,0 +1,182 @@ +" Vim color scheme +" +" Name: monochrome.vim +" Maintainer: Xavier Noria <fxn@hashref.com> +" Modifications: Michael Smith <mikesmiffy128@gmail.com> +" Light mode: Matthew Wozniak <me@woz.blue> +" License: MIT + +set bg=light + +" TODO: make non-C stuff even less colourful + +hi clear +if exists('syntax_on') + syntax reset +endif + +let g:colors_name = 'monochrome' + +let s:white = ['White', 15] +let s:black = ['Black', 16] +let s:bgray = ['#181818', 233] +let s:lgray = ['LightGray', 255] +let s:cgray = ['#737373', 243] +let s:dgray = ['DarkGray', 248] +let s:sblue = ['Blue', 67] +let s:lblue = ['LightBlue', 6] +let s:sgreen = ['Green', 67] +let s:yellow = ['Yellow', 226] +let s:red = ['#b6403a', 160] +let s:green = ['#478226', 28] +let s:purple = ['#a652c6', 28] + +let s:italic = 'italic' +let s:bold = 'bold' +let s:underline = 'underline' +let s:none = 'NONE' +let s:cnone = [s:none, s:none] + +let s:default_fg = s:black +" For slight terminal transparency, configure the terminal background to be the +" same - or whatever is actually desired. +let s:default_bg = s:cnone +" let s:default_bg = none + +function! s:hi(...) + let group = a:1 + let fg = get(a:, 2, s:cnone) + let bg = get(a:, 3, s:cnone) + let attr = get(a:, 4, s:none) + let cmd = ['hi', group] + call add(cmd, 'guifg='.fg[0]) + call add(cmd, 'ctermfg='.fg[1]) + call add(cmd, 'guibg='.bg[0]) + call add(cmd, 'ctermbg='.bg[1]) + call add(cmd, 'gui='.attr) + call add(cmd, 'cterm='.attr) + exec join(cmd, ' ') +endfunction + +" Vim interface +call s:hi('Normal', s:default_fg, s:default_bg) +call s:hi('Cursor', s:black, s:lgray) +call s:hi('CursorLine', s:cnone, s:bgray) +call s:hi('CursorLineNr', s:black, s:default_bg, s:bold) +call s:hi('ColorColumn', s:cnone, s:bgray) +call s:hi('Search', s:black, s:lblue) +call s:hi('Visual', s:default_fg, s:lblue) +call s:hi('ErrorMsg', s:black, s:red) +call s:hi('NonText', s:sblue) +call s:hi('FoldColumn', s:dgray) +call s:hi('Folded') +call s:hi('LineNr', s:dgray) +call s:hi('SpecialKey', s:sblue, s:default_bg, s:bold) +call s:hi('Directory', s:black, s:default_bg, s:bold) +call s:hi('helpSpecial') +call s:hi('helpHyperTextJump', s:sblue, s:default_bg, s:underline) +call s:hi('helpNote') +call s:hi('Pmenu', s:black, s:white) +call s:hi('PmenuSel', s:white, s:black) +call s:hi('Todo', s:black, s:cnone, s:bold.','.s:italic) +call s:hi('SignColumn', s:default_fg, s:cnone) +call s:hi('VertSplit') + +" Programming languages +call s:hi('Statement', s:cnone, s:cnone, s:italic) +call s:hi('PreProc', s:cnone, s:cnone, s:italic) +call s:hi('String', s:sgreen) +call s:hi('Comment', s:black, s:default_bg, s:bold) +call s:hi('Constant', s:cnone, s:cnone, s:bold) +call s:hi('Type') +call s:hi('Function') +call s:hi('Identifier') +call s:hi('Special') +call s:hi('MatchParen', s:default_fg, s:dgray) + +" VimL +call s:hi('vimOption') +call s:hi('vimGroup') +call s:hi('vimHiClear') +call s:hi('vimHiGroup') +call s:hi('vimHiAttrib') +call s:hi('vimHiGui') +call s:hi('vimHiGuiFgBg') +call s:hi('vimHiCTerm') +call s:hi('vimHiCTermFgBg') +call s:hi('vimSynType') +hi link vimCommentTitle Comment + +" Ruby +call s:hi('rubyConstant') +call s:hi('rubySharpBang', s:cgray) +call s:hi('rubyStringDelimiter', s:sblue) +call s:hi('rubyStringEscape', s:sblue) +call s:hi('rubyRegexpEscape', s:sblue) +call s:hi('rubyRegexpAnchor', s:sblue) +call s:hi('rubyRegexpSpecial', s:sblue) + +" Elixir +call s:hi('elixirAlias') +call s:hi('elixirDelimiter', s:sblue) +call s:hi('elixirSelf') +call s:hi('elixirOperator') " For ||, ->, etc. +hi link elixirVariable Statement " Module attributes like @doc or @type. +" While rendered as comments in other languages, docstrings are strings, +" experimental. +hi link elixirDocString String +hi link elixirDocTest String +hi link elixirStringDelimiter String + +" Perl +call s:hi('perlSharpBang', s:cgray) +call s:hi('perlStringStartEnd', s:sblue) +call s:hi('perlStringEscape', s:sblue) +call s:hi('perlMatchStartEnd', s:sblue) + +" Python +call s:hi('pythonEscape', s:sblue) + +" JavaScript +call s:hi('javaScriptFunction', s:black, s:default_bg, s:bold) + +" Diffs and Signify columns +call s:hi('diffFile', s:cgray) +call s:hi('diffNewFile', s:cgray) +call s:hi('diffIndexLine', s:cgray) +call s:hi('diffLine', s:cgray) +call s:hi('diffSubname', s:cgray) +call s:hi('diffAdded', s:black, s:green) +call s:hi('DiffAdd', s:black, s:green) +call s:hi('diffRemoved', s:black, s:red) +call s:hi('DiffDelete', s:black, s:red) +call s:hi('DiffChange', s:black, s:purple) + +" Markdown +call s:hi('Title', s:black, s:default_bg, s:bold) +call s:hi('markdownHeadingDelimiter', s:black, s:default_bg, s:bold) +call s:hi('markdownHeadingRule', s:black, s:default_bg, s:bold) +call s:hi('markdownLinkText', s:sblue, s:default_bg, s:underline) + +" vim-fugitive +call s:hi('gitcommitComment', s:default_fg, s:default_bg) +call s:hi('gitcommitOnBranch', s:default_fg, s:default_bg) +call s:hi('gitcommitBranch', s:sblue, s:default_bg) +:call s:hi('gitcommitHeader', s:black, s:default_bg, s:bold) +call s:hi('gitcommitSelected', s:default_fg, s:default_bg) +call s:hi('gitcommitDiscarded', s:default_fg, s:default_bg) +call s:hi('gitcommitSelectedType', s:default_fg, s:default_bg) +call s:hi('gitcommitDiscardedType', s:default_fg, s:default_bg) + +" NeoMake +call s:hi('NeomakeMessageSign') +call s:hi('NeomakeWarningSign', s:sblue) +call s:hi('NeomakeErrorSign', s:yellow) +call s:hi('NeomakeInfoSign') +call s:hi('NeomakeError', s:yellow) +call s:hi('NeomakeInfo', s:default_fg, s:default_bg, s:bold) +call s:hi('NeomakeMessage') +call s:hi('NeomakeWarning', s:yellow) + +" vi: sw=4 ts=4 noet tw=80 cc=80 + @@ -27,10 +27,20 @@ require("lazy").setup({ { "ibhagwan/fzf-lua", dependencies = { "nvim-tree/nvim-web-devicons" }, - opts = {}, + opts = { + previewers = {}, + winopts = { + width = 0.4, + height = 0.5, + backdrop = 0, + border = 'none', + preview = { + hidden = true + } + } + }, }, { "m4xshen/autoclose.nvim", opts = {} }, - { "nyoom-engineering/oxocarbon.nvim" }, { "neovim/nvim-lspconfig" }, { 'hrsh7th/cmp-nvim-lsp' }, { 'hrsh7th/cmp-buffer' }, @@ -42,12 +52,24 @@ require("lazy").setup({ { 'nvim-lualine/lualine.nvim', dependencies = { 'nvim-tree/nvim-web-devicons' }, - opts = {}, + opts = { options = { + theme = 'onelight', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + }}, }, + { + 'chomosuke/typst-preview.nvim', + lazy = false, + version = '1.*', + opts = { + invert_colors = 'auto', + }, + } }, -- Configure any other settings here. See the documentation for more details. -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "monokai" } }, + install = { colorscheme = { 'monochrome' } }, -- automatically check for plugin updates checker = { enabled = true, notify = false }, }) |