diff --git a/nvim/init.lua b/nvim/init.lua index 254e1a7..bd861d8 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -25,8 +25,11 @@ require("packer").startup(function() -- Let the package manager manage itself. use { "wbthomason/packer.nvim", opt = true } - -- THEMES! - use { "chriskempson/base16-vim" } + -- THEMES! + use { "chriskempson/base16-vim" } + + -- Custom color themes! + use { "rktjmp/lush.nvim" } -- EditorConfig plugin use { "editorconfig/editorconfig-vim" } @@ -39,10 +42,18 @@ require("packer").startup(function() end } + -- Start flavours + -- Our custom theme + use { "~/.config/nvim/lua/lush_theme/fds-theme.lua" } + -- A snippets engine. -- One of the must-haves for me. use { "sirver/ultisnips", + config = function() + vim.g.UltiSnipsEditSplit = "context" + vim.g.UltiSnipsSnippetDirectories = {vim.env.HOME .. "/.config/nvim/own-snippets", ".snippets"} + end, -- Contains various snippets for UltiSnips. requires = "honza/vim-snippets" @@ -75,14 +86,14 @@ require("packer").startup(function() end local check_back_space = function() - local col = vim.fn.col(".") - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") ~= nil + local col = fn.col(".") - 1 + return col == 0 or fn.getline("."):sub(col, col):match("%s") ~= nil end cmp.setup({ snippet = { expand = function(args) - vim.fn["UltiSnips#Anon"](args.body) + fn["UltiSnips#Anon"](args.body) end, }, @@ -96,14 +107,14 @@ require("packer").startup(function() mapping = { [""] = cmp.mapping(function(fallback) - if vim.fn.pumvisible() == 1 then - if vim.fn["UltiSnips#CanExpandSnippet"]() == 1 then - return vim.fn.feedkeys(t("=UltiSnips#ExpandSnippet()")) + if fn.pumvisible() == 1 then + if fn["UltiSnips#CanExpandSnippet"]() == 1 then + return fn.feedkeys(t("=UltiSnips#ExpandSnippet()")) end - vim.fn.feedkeys(t(""), "n") + fn.feedkeys(t(""), "n") elseif check_back_space() then - vim.fn.feedkeys(t(""), "n") + fn.feedkeys(t(""), "n") else fallback() end @@ -113,14 +124,14 @@ require("packer").startup(function() }), [""] = cmp.mapping(function(fallback) - if vim.fn.complete_info()["selected"] == -1 and vim.fn["UltiSnips#CanExpandSnippet"]() == 1 then - vim.fn.feedkeys(t("=UltiSnips#ExpandSnippet()")) - elseif vim.fn["UltiSnips#CanJumpForwards"]() == 1 then - vim.fn.feedkeys(t(":call UltiSnips#JumpForwards()")) - elseif vim.fn.pumvisible() == 1 then - vim.fn.feedkeys(t(""), "n") + if fn.complete_info()["selected"] == -1 and fn["UltiSnips#CanExpandSnippet"]() == 1 then + fn.feedkeys(t("=UltiSnips#ExpandSnippet()")) + elseif fn["UltiSnips#CanJumpForwards"]() == 1 then + fn.feedkeys(t(":call UltiSnips#JumpForwards()")) + elseif fn.pumvisible() == 1 then + fn.feedkeys(t(""), "n") elseif check_back_space() then - vim.fn.feedkeys(t(""), "n") + fn.feedkeys(t(""), "n") else fallback() end @@ -130,10 +141,10 @@ require("packer").startup(function() }), [""] = cmp.mapping(function(fallback) - if vim.fn["UltiSnips#CanJumpBackwards"]() == 1 then - return vim.fn.feedkeys(t("=UltiSnips#JumpBackwards()")) - elseif vim.fn.pumvisible() == 1 then - vim.fn.feedkeys(t(""), "n") + if fn["UltiSnips#CanJumpBackwards"]() == 1 then + return fn.feedkeys(t("=UltiSnips#JumpBackwards()")) + elseif fn.pumvisible() == 1 then + fn.feedkeys(t(""), "n") else fallback() end @@ -202,16 +213,14 @@ require("packer").startup(function() end) -- g['UltiSnipsExpandTrigger'] = "" -g['UltiSnipsEditSplit'] = "context" -g['UltiSnipsSnippetDirectories'] = {vim.env.HOME .. "/.config/nvim/own-snippets", ".snippets"} local t = function(str) return vim.api.nvim_replace_termcodes(str, true, true, true) end local check_back_space = function() - local col = vim.fn.col('.') - 1 - if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then + local col = fn.col('.') - 1 + if col == 0 or fn.getline('.'):sub(col, col):match('%s') then return true else return false @@ -241,6 +250,7 @@ cmd "highlight clear SpellCap" cmd "highlight clear SpellRare" cmd "highlight CursorLineNr ctermfg=cyan" cmd "highlight Visual term=reverse cterm=reverse" +cmd "colorscheme fds-theme" -- Keybindings map('i', 'jk', '', {})