From 85d91ffe3f4678578cb527409e4a5cf0b82d8bc7 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Tue, 6 Jun 2023 23:30:57 -0400 Subject: [PATCH] making progress --- homeConfig/modules/gui/config/sway.nix | 2 +- homeConfig/modules/neovim/config/config.nix | 111 -------------------- homeConfig/modules/neovim/config/init.nix | 6 +- homeConfig/modules/neovim/default.nix | 1 - 4 files changed, 3 insertions(+), 117 deletions(-) delete mode 100644 homeConfig/modules/neovim/config/config.nix diff --git a/homeConfig/modules/gui/config/sway.nix b/homeConfig/modules/gui/config/sway.nix index 3db8a1c..9dc036d 100644 --- a/homeConfig/modules/gui/config/sway.nix +++ b/homeConfig/modules/gui/config/sway.nix @@ -22,7 +22,7 @@ in HDMI-A-1 = { resolution = "1920x1080"; position = "1920,0"; - bg = "~/Pictures/wallpapers/mountains.jpg"; + bg = "~/Pictures/wallpapers/mountains.jpg fill"; }; }; modifier = "Mod1"; diff --git a/homeConfig/modules/neovim/config/config.nix b/homeConfig/modules/neovim/config/config.nix deleted file mode 100644 index da3fc73..0000000 --- a/homeConfig/modules/neovim/config/config.nix +++ /dev/null @@ -1,111 +0,0 @@ -# Already read as a lua file -'' -require("config.lazy") - -local lsp = require("lsp-zero").preset({}) - -lsp.on_attach(function(client, bufnr) - lsp.default_keymaps({ buffer = bufnr }) -end) - -lsp.setup_servers({ - "tsserver", - "eslint", - "hls", - "pyright", - "nil_ls", - "cssls", - "html", - "jsonls", - "diagnosticls", - "lua_ls", - "marksman", - "purescriptls", - "tailwindcss", - "bashls", -}) - -require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls()) - -lsp.setup() - -local cmp = require("cmp") -cmp.setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, -}) - -local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil -end - -local luasnip = require("luasnip") - -cmp.setup({ - enabled = function() - -- disable completion in comments - local context = require("cmp.config.context") - -- keep command mode completion enabled when cursor is in a comment - if vim.api.nvim_get_mode().mode == "c" then - return true - else - return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment") - end - end, - mapping = { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- they way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - - [""] = cmp.mapping({ - i = function(fallback) - if cmp.visible() and cmp.get_active_entry() then - cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }) - else - fallback() - end - end, - s = cmp.mapping.confirm({ select = true }), - c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), - }), - }, -}) - -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - -- Disable virtual_text - virtual_text = false, -}) - -require("notify").setup({ - background_colour = "#000000", -}) -'' diff --git a/homeConfig/modules/neovim/config/init.nix b/homeConfig/modules/neovim/config/init.nix index cf5209c..81846e0 100644 --- a/homeConfig/modules/neovim/config/init.nix +++ b/homeConfig/modules/neovim/config/init.nix @@ -1,10 +1,9 @@ '' -lua << EOF + vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 vim.opt.expandtab = true -vim.o.guicursor = \'\' vim.o.clipboard = "unnamedplus" vim.o.foldmethod = "indent" @@ -122,5 +121,4 @@ vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagn require("notify").setup({ background_colour = "#000000", }) -EOF -'' +'' diff --git a/homeConfig/modules/neovim/default.nix b/homeConfig/modules/neovim/default.nix index 9a02bf4..51be40f 100644 --- a/homeConfig/modules/neovim/default.nix +++ b/homeConfig/modules/neovim/default.nix @@ -13,7 +13,6 @@ in vimAlias = true; extraLuaConfig = import ./config/init.nix; -# generatedConfigs = {lua = import ./config/config.nix;}; plugins = import ./config/plugins.nix { inherit pkgs; }; extraPackages = import ./config/lsp.nix { inherit pkgs; }; };