From df0bcb87cffe0fb5d1eb300ac231ea7de3bb2e04 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 3 May 2022 11:40:07 +0200 Subject: [PATCH] feat: some stuff --- configs/.Xresources | 78 ----------------- configs/{zsh => }/.zshrc | 0 configs/init.lua | 0 configs/kitty/current-theme.conf | 42 +++++----- configs/kitty/kitty.conf | 2 +- configs/kitty/kitty.conf.bak | 2 +- configs/nvim/ftplugin/markdown.lua | 4 - configs/nvim/ftplugin/markdown.vim | 1 + configs/nvim/init.lua | 1 - configs/nvim/lua/configs/command-center.lua | 29 ++++--- configs/nvim/lua/configs/lsp.lua | 93 ++++++++++----------- configs/nvim/lua/configs/lspinstaller.lua | 34 -------- configs/nvim/lua/core/autocommands.lua | 2 - configs/nvim/lua/core/plugins.lua | 12 +-- configs/nvim/lua/lua | 1 + 15 files changed, 89 insertions(+), 212 deletions(-) delete mode 100644 configs/.Xresources rename configs/{zsh => }/.zshrc (100%) delete mode 100644 configs/init.lua delete mode 100644 configs/nvim/ftplugin/markdown.lua create mode 100644 configs/nvim/ftplugin/markdown.vim delete mode 100644 configs/nvim/lua/configs/lspinstaller.lua create mode 120000 configs/nvim/lua/lua diff --git a/configs/.Xresources b/configs/.Xresources deleted file mode 100644 index 5e8ab96..0000000 --- a/configs/.Xresources +++ /dev/null @@ -1,78 +0,0 @@ -Xft.autohint: 0 -Xft.dpi: 96 -Xft.antialias: true -Xft.rgba: rgb -Xft.hinting: true -Xft.hintstyle: hintslight -Xft.lcdfilter: lcddefault - -URxvt.font: xft:FiraMono Nerd Font:size=11:antialias=true -URxvt.boldFont: xft:FiraMono Nerd Font:bold:size=11:antialias=true -URxvt.italicFont: xft:FiraMono Nerd Font:italic:size=11:antialias=true - -URxvt.letterSpace: -1 -URxvt.lineSpace: 0 -URxvt.geometry: 92x24 -URxvt.internalBorder: 10 -URxvt.externalBorder: 0 -URxvt.cursorBlink: true -URxvt.cursorUnderline: false -URxvt.saveline: 2048 -URxvt.scrollBar: false -URxvt.scrollBar_right: false -URxvt.urgentOnBell: true -URxvt.depth: 24 -URxvt.imLocale: en_US.utf8 -URxvt.perl-ext-common: default,matcher,font-size -URxvt.font-size.step: 2 - -! Resize Text -URxvt.keysym.C-Up: font-size:increase -URxvt.keysym.C-Down: font-size:decrease - -! Enable Copy/Paste -Rxvt.iso14755: false -URxvt.iso14755_52: false -URxvt.keysym.Shift-Control-V: eval:paste_clipboard -URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard - -! margins -*.gap: 6 - -! special -*.foreground: #c0c5ce -*.background: #2b303b -*.cursorColor: #c0c5ce - -! black -*.color0: #2b303b -*.color8: #65737e - -! red -*.color1: #bf616a -*.color9: #bf616a - -! green -*.color2: #a3be8c -*.color10: #a3be8c - -! yellow -*.color3: #ebcb8b -*.color11: #ebcb8b - -! blue -*.color4: #8fa1b3 -*.color12: #8fa1b3 - -! magenta -*.color5: #b48ead -*.color13: #b48ead - -! cyan -*.color6: #96b5b4 -*.color14: #96b5b4 - -! white -*.color7: #c0c5ce -*.color15: #eff1f5 - diff --git a/configs/zsh/.zshrc b/configs/.zshrc similarity index 100% rename from configs/zsh/.zshrc rename to configs/.zshrc diff --git a/configs/init.lua b/configs/init.lua deleted file mode 100644 index e69de29..0000000 diff --git a/configs/kitty/current-theme.conf b/configs/kitty/current-theme.conf index 056ef3b..29f8f9e 100644 --- a/configs/kitty/current-theme.conf +++ b/configs/kitty/current-theme.conf @@ -1,21 +1,21 @@ -background #f8f8f8 -foreground #2a2b33 -cursor #bbbbbb -selection_background #ececec -color0 #000000 -color8 #000000 -color1 #de3d35 -color9 #de3d35 -color2 #3e953a -color10 #3e953a -color3 #d2b67b -color11 #d2b67b -color4 #2f5af3 -color12 #2f5af3 -color5 #950095 -color13 #a00095 -color6 #3e953a -color14 #3e953a -color7 #bbbbbb -color15 #ffffff -selection_foreground #f8f8f8 +background #000000 +foreground #fffaf3 +cursor #ffffff +selection_background #002a3a +color0 #222222 +color8 #444444 +color1 #ff000f +color9 #ff273f +color2 #8ce00a +color10 #abe05a +color3 #ffb900 +color11 #ffd141 +color4 #008df8 +color12 #0092ff +color5 #6c43a5 +color13 #9a5feb +color6 #00d7eb +color14 #67ffef +color7 #ffffff +color15 #ffffff +selection_foreground #0d0f18 diff --git a/configs/kitty/kitty.conf b/configs/kitty/kitty.conf index 8c61916..c625178 100644 --- a/configs/kitty/kitty.conf +++ b/configs/kitty/kitty.conf @@ -1314,6 +1314,6 @@ map kitty_mod+minus change_font_size all -2.0 # BEGIN_KITTY_THEME -# Atom One Light +# Argonaut include current-theme.conf # END_KITTY_THEME diff --git a/configs/kitty/kitty.conf.bak b/configs/kitty/kitty.conf.bak index c625178..8c61916 100644 --- a/configs/kitty/kitty.conf.bak +++ b/configs/kitty/kitty.conf.bak @@ -1314,6 +1314,6 @@ map kitty_mod+minus change_font_size all -2.0 # BEGIN_KITTY_THEME -# Argonaut +# Atom One Light include current-theme.conf # END_KITTY_THEME diff --git a/configs/nvim/ftplugin/markdown.lua b/configs/nvim/ftplugin/markdown.lua deleted file mode 100644 index 41bcd2d..0000000 --- a/configs/nvim/ftplugin/markdown.lua +++ /dev/null @@ -1,4 +0,0 @@ -local map = vim.api.nvim_set_keymap - - -map("i", "", ">a**", { noremap = true }) diff --git a/configs/nvim/ftplugin/markdown.vim b/configs/nvim/ftplugin/markdown.vim new file mode 100644 index 0000000..9f06c51 --- /dev/null +++ b/configs/nvim/ftplugin/markdown.vim @@ -0,0 +1 @@ +inoremap **** diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index 711ef24..e177292 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -23,7 +23,6 @@ if u.has_plugin("packer") then require "configs.command-center" require "configs.notify" require "configs.lsp" - require "configs.lspinstaller" require "configs.telescope" require "configs.tree" require "configs.treesitter" diff --git a/configs/nvim/lua/configs/command-center.lua b/configs/nvim/lua/configs/command-center.lua index bb1bc2b..c151e1c 100644 --- a/configs/nvim/lua/configs/command-center.lua +++ b/configs/nvim/lua/configs/command-center.lua @@ -1,31 +1,34 @@ local command_center = require("command_center") -local noremap = {noremap = true} +local noremap = { noremap = true } command_center.add({ { description = "Search inside current buffer", cmd = "Telescope current_buffer_fuzzy_find", keybindings = { "n", "fl", noremap }, - }, { + }, { -- If no descirption is specified, command is used to replace descirption by default -- You can change this behavior in settigns cmd = "Telescope find_files", - }, - { - -- If no keybindings specified, no keybindings will be displayed or registered - description = "Find hidden files", - cmd = "Telescope find_files hidden=true", - }, - { + }, + { + -- If no keybindings specified, no keybindings will be displayed or registered + description = "Find hidden files", + cmd = "Telescope find_files hidden=true", + }, + { -- You can specify multiple keybindings for the same command ... description = "Show document symbols", cmd = "Telescope lsp_document_symbols", - }, - { + }, + { description = "Show function signaure (hover)", cmd = "lua vim.lsp.buf.hover()", - },{ - description="(TS) Organize Imports", + }, { + description = "(TS) Organize Imports", cmd = "OrganizeImports" + }, { + description = "ZenMode", + cmd = "ZenMode" } }) diff --git a/configs/nvim/lua/configs/lsp.lua b/configs/nvim/lua/configs/lsp.lua index 14509f5..e0e27fa 100644 --- a/configs/nvim/lua/configs/lsp.lua +++ b/configs/nvim/lua/configs/lsp.lua @@ -1,58 +1,17 @@ -local lsp = require "lspconfig" -local lsp_status = require("lsp-status") --- local ts_utils = require("nvim-lsp-ts-utils") - -require 'nvim-lightbulb'.setup { - -- LSP client names to ignore - -- Example: {"sumneko_lua", "null-ls"} - ignore = {}, - sign = { - enabled = true, - -- Priority of the gutter sign - priority = 10, - }, - float = { - enabled = false, - -- Text to show in the popup float - text = "💡", - -- Available keys for window options: - -- - height of floating window - -- - width of floating window - -- - wrap_at character to wrap at for computing height - -- - max_width maximal width of floating window - -- - max_height maximal height of floating window - -- - pad_left number of columns to pad contents at left - -- - pad_right number of columns to pad contents at right - -- - pad_top number of lines to pad contents at top - -- - pad_bottom number of lines to pad contents at bottom - -- - offset_x x-axis offset of the floating window - -- - offset_y y-axis offset of the floating window - -- - anchor corner of float to place at the cursor (NW, NE, SW, SE) - -- - winblend transparency of the window (0-100) - win_opts = {}, - }, - virtual_text = { - enabled = false, - -- Text to show at virtual text - text = "💡", - -- highlight mode to use for virtual text (replace, combine, blend), see :help nvim_buf_set_extmark() for reference - hl_mode = "replace", - }, - status_text = { - enabled = false, - -- Text to provide when code actions are available - text = "💡", - -- Text to provide when no actions are available - text_unavailable = "" - } +local lsp_installer = require("nvim-lsp-installer") +lsp_installer.setup { + ensure_installed = { "sumneko_lua", "jsonls", "tsserver", "svelte", "cssls" } } - +local lsp = require "lspconfig" +local lsp_format = require("lsp-format"); +lsp_format.setup {} local runtime_path = vim.split(package.path, ";") table.insert(runtime_path, "lua/?.lua") table.insert(runtime_path, "lua/?/init.lua") lsp.sumneko_lua.setup { + on_attach = lsp_format.on_attach, settings = { Lua = { runtime = { @@ -77,5 +36,43 @@ lsp.sumneko_lua.setup { } } + +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +lsp.jsonls.setup { + capabilities = capabilities, + on_attach = lsp_format.on_attach, + settings = { + json = { + schemas = { + { + description = 'TypeScript compiler configuration file', + fileMatch = { 'tsconfig.json', 'tsconfig.*.json' }, + url = 'http://json.schemastore.org/tsconfig' + }, + { + description = 'ESLint config', + fileMatch = { '.eslintrc.json', '.eslintrc' }, + url = 'http://json.schemastore.org/eslintrc' + }, + { + description = 'Prettier config', + fileMatch = { '.prettierrc', '.prettierrc.json', 'prettier.config.json' }, + url = 'http://json.schemastore.org/prettierrc' + }, + } + }, + } +} + +lsp.svelte.setup { + on_attach = lsp_format.on_attach +} + +lsp.tsserver.setup { + on_attach = lsp_format.on_attach +} + -- Ltex Language Server require("grammar-guard").init() diff --git a/configs/nvim/lua/configs/lspinstaller.lua b/configs/nvim/lua/configs/lspinstaller.lua deleted file mode 100644 index 99b1462..0000000 --- a/configs/nvim/lua/configs/lspinstaller.lua +++ /dev/null @@ -1,34 +0,0 @@ -local lsp_installer = require("nvim-lsp-installer") -local lsp_format = require("lsp-format"); -lsp_format.setup {} - -local function organize_imports() - local params = { - command = "_typescript.organizeImports", - arguments = {vim.api.nvim_buf_get_name(0)}, - title = "" - } - vim.lsp.buf.execute_command(params) -end - - -lsp_installer.on_server_ready( - function(server) - - local opts = { - on_attach = lsp_format.on_attach - } - - if server.name == "tsserver" then - opts.commands = { - OrganizeImports = { - organize_imports, - description = "Organize Imports" - } - } - end - - -- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart) - server:setup(opts) - end -) diff --git a/configs/nvim/lua/core/autocommands.lua b/configs/nvim/lua/core/autocommands.lua index 8a28904..19cf3d6 100644 --- a/configs/nvim/lua/core/autocommands.lua +++ b/configs/nvim/lua/core/autocommands.lua @@ -22,8 +22,6 @@ augroup SaveManualFolds augroup END ]] -vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb()]] - vim.api.nvim_create_autocmd("BufWritePre", { callback = function() vim.lsp.buf.formatting_sync(); diff --git a/configs/nvim/lua/core/plugins.lua b/configs/nvim/lua/core/plugins.lua index e25b0a9..5613405 100644 --- a/configs/nvim/lua/core/plugins.lua +++ b/configs/nvim/lua/core/plugins.lua @@ -12,10 +12,11 @@ return require("packer").startup( use "nvim-lualine/lualine.nvim" -- Layout Plugins + use { "folke/zen-mode.nvim", config = function() require("zen-mode").setup {} end } + use "rcarriga/nvim-notify" use "kyazdani42/nvim-web-devicons" use "kyazdani42/nvim-tree.lua" use "nvim-lua/popup.nvim" - -- use "mhinz/vim-startify" use 'goolord/alpha-nvim' use { "terrortylor/nvim-comment", config = function() require('nvim_comment').setup() end } use "windwp/nvim-autopairs" @@ -25,13 +26,6 @@ return require("packer").startup( use "nvim-telescope/telescope.nvim" use "gfeiyou/command-center.nvim" - -- Postman like features - -- use "NTBBloodbath/rest.nvim" - - -- Obsidian / Roam like features - -- use "lervag/wiki.vim" - - use "rcarriga/nvim-notify" -- Lsp Errors use "folke/lsp-colors.nvim" @@ -45,6 +39,7 @@ return require("packer").startup( } -- Syntax / Autocomplete + use "tpope/vim-surround" use "neovim/nvim-lspconfig" use "hrsh7th/nvim-cmp" use "hrsh7th/cmp-nvim-lsp" @@ -57,7 +52,6 @@ return require("packer").startup( use "L3MON4D3/LuaSnip" use "saadparwaiz1/cmp_luasnip" use "williamboman/nvim-lsp-installer" - use "nvim-lua/lsp-status.nvim" use "brymer-meneses/grammar-guard.nvim" use { "nvim-treesitter/nvim-treesitter", diff --git a/configs/nvim/lua/lua b/configs/nvim/lua/lua new file mode 120000 index 0000000..881bb51 --- /dev/null +++ b/configs/nvim/lua/lua @@ -0,0 +1 @@ +/home/max/.dotfiles/configs/lua \ No newline at end of file