From b33502bf54887be64b875e1b4ce7c2fe33b3c797 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Thu, 3 Feb 2022 12:34:50 +0100 Subject: [PATCH] feat: fix clipboard --- configs/nvim/init.lua | 49 +++++++++++++++++-- configs/nvim/lua/lsp-conf.lua | 33 +++++-------- configs/nvim/lua/plugins.lua | 2 +- configs/nvim/lua/telescope-conf.lua | 71 ++++++++++++++++++++++++++++ configs/nvim/lua/treesitter-conf.lua | 24 +++++----- configs/sway/config | 5 +- 6 files changed, 144 insertions(+), 40 deletions(-) create mode 100644 configs/nvim/lua/telescope-conf.lua diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index 632d7c8..bdbb566 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -25,6 +25,7 @@ if u.has_plugin("cmp") then g.hidden = true -- unload buffers when hidden g.filetype = true -- execute autocommands based on filetype + opt.clipboard = {"unnamedplus"} o.autoread = true opt.termguicolors = true @@ -85,10 +86,50 @@ if u.has_plugin("cmp") then ) require("telescope").setup { - pickers = { - find_files = { - hidden = true - } + defaults = { + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case" + }, + prompt_prefix = "  ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "ascending", + layout_strategy = "horizontal", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.55, + results_width = 0.8 + }, + vertical = { + mirror = false + }, + width = 0.87, + height = 0.80, + preview_cutoff = 120 + }, + file_sorter = require("telescope.sorters").get_fuzzy_file, + file_ignore_patterns = {"node_modules"}, + generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, + path_display = {"truncate"}, + winblend = 0, + border = {}, + borderchars = {"─", "│", "─", "│", "╭", "╮", "╯", "╰"}, + color_devicons = true, + use_less = true, + set_env = {["COLORTERM"] = "truecolor"}, -- default = nil, + file_previewer = require("telescope.previewers").vim_buffer_cat.new, + grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, + qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new + -- Developer configurations: Not meant for general override } } diff --git a/configs/nvim/lua/lsp-conf.lua b/configs/nvim/lua/lsp-conf.lua index 8fa0c20..bb70273 100644 --- a/configs/nvim/lua/lsp-conf.lua +++ b/configs/nvim/lua/lsp-conf.lua @@ -17,29 +17,13 @@ local function on_attach() vim.api.nvim_buf_map(bufnr, "n", "gs", ":LspOrganize", {silent = true}) end -local system_name = "" --- Lua Language Server -if vim.fn.has("mac") == 1 then - system_name = "macOS" -elseif vim.fn.has("unix") == 1 then - system_name = "Linux" -elseif vim.fn.has("win32") == 1 then - system_name = "Windows" -else - print("Unsupported system for sumneko") -end - -local sumneko_root_path = "/home/jim/.local/share/lua-language-server" -local sumneko_binary = sumneko_root_path .. "/bin/" .. system_name .. "/lua-language-server" - 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 = on_attach, - capabilities = lsp_status.capabilities, - cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, +print(runtime_path) + +require "lspconfig".sumneko_lua.setup { settings = { Lua = { runtime = { @@ -50,7 +34,7 @@ lsp.sumneko_lua.setup { }, diagnostics = { -- Get the language server to recognize the `vim` global - globals = {"vim", "bufnr", "use"} + globals = {"vim"} }, workspace = { -- Make the server aware of Neovim runtime files @@ -67,7 +51,14 @@ lsp.sumneko_lua.setup { -- Ltex Language Server lsp.ltex.setup { ltex = { - language = {"de", "en", "es"} + completionEnabled = true, + language = {"de", "en", "es"}, + configurationTarget = {}, + statusBarItem = true, + dictionary = { + ["de"] = {"~/test.txt"}, + ["en"] = {"~/test.txt"} + } } } diff --git a/configs/nvim/lua/plugins.lua b/configs/nvim/lua/plugins.lua index b907fbe..230adae 100644 --- a/configs/nvim/lua/plugins.lua +++ b/configs/nvim/lua/plugins.lua @@ -47,7 +47,7 @@ return require("packer").startup( "folke/trouble.nvim", requires = "kyazdani42/nvim-web-devicons", config = function() - require("trouble").setup() + require("trouble").setup {} end } diff --git a/configs/nvim/lua/telescope-conf.lua b/configs/nvim/lua/telescope-conf.lua new file mode 100644 index 0000000..3e5e875 --- /dev/null +++ b/configs/nvim/lua/telescope-conf.lua @@ -0,0 +1,71 @@ +local present, telescope = pcall(require, "telescope") + +if not present then + return +end + +local default = { + defaults = { + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case" + }, + prompt_prefix = "  ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "ascending", + layout_strategy = "horizontal", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.55, + results_width = 0.8 + }, + vertical = { + mirror = false + }, + width = 0.87, + height = 0.80, + preview_cutoff = 120 + }, + file_sorter = require("telescope.sorters").get_fuzzy_file, + file_ignore_patterns = {"node_modules"}, + generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, + path_display = {"truncate"}, + winblend = 0, + border = {}, + borderchars = {"─", "│", "─", "│", "╭", "╮", "╯", "╰"}, + color_devicons = true, + use_less = true, + set_env = {["COLORTERM"] = "truecolor"}, -- default = nil, + file_previewer = require("telescope.previewers").vim_buffer_cat.new, + grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, + qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, + -- Developer configurations: Not meant for general override + buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker + } +} + +local M = {} +M.setup = function() + telescope.setup(default) + + local extensions = {"themes", "terms"} + + pcall( + function() + for _, ext in ipairs(extensions) do + -- telescope.load_extension(ext) + end + end + ) +end + +return M diff --git a/configs/nvim/lua/treesitter-conf.lua b/configs/nvim/lua/treesitter-conf.lua index 07222b9..425df13 100644 --- a/configs/nvim/lua/treesitter-conf.lua +++ b/configs/nvim/lua/treesitter-conf.lua @@ -1,17 +1,17 @@ -local parser_configs = require("nvim-treesitter.parsers").get_parser_configs() +-- local parser_configs = require("nvim-treesitter.parsers").get_parser_configs() -parser_configs.http = { - install_info = { - url = "https://github.com/NTBBloodbath/tree-sitter-http", - files = {"src/parser.c"}, - branch = "main" - } -} +-- parser_configs.http = { +-- install_info = { +-- url = "https://github.com/NTBBloodbath/tree-sitter-http", +-- files = {"src/parser.c"}, +-- branch = "main" +-- } +-- } -parser_configs.glsl = { - filetype = "vert", - filetypes = {"vert", "frag"} -} +-- parser_configs.glsl = { +-- filetype = "vert", +-- filetypes = {"vert", "frag"} +-- } require "nvim-treesitter.configs".setup { indent = { diff --git a/configs/sway/config b/configs/sway/config index 6cbe8e6..53c0a8f 100644 --- a/configs/sway/config +++ b/configs/sway/config @@ -19,7 +19,6 @@ set $left h set $down j set $up k set $right l -# Your preferred terminal emulator # Some menus set $wofi_scripts ~/.config/wofi @@ -192,7 +191,9 @@ exec swayidle -w \ # Note: workspaces can have any name you want, not just numbers. # We just use 1-10 as the default. - +for_window [class="zoom"] floating enable +for_window [title="Zoom Meeting.*"] floating disable +for_window [title="Zoom Meeting.*"] inhibit_idle visible # # Layout stuff: