Nord Theme

This commit is contained in:
Evan Reichard
2022-12-01 17:00:33 -05:00
parent 6fcfd5757a
commit c6a7eaada6
11 changed files with 578 additions and 181 deletions

View File

@@ -1,5 +1,8 @@
-- Set Theme
vim.cmd('colorscheme embark')
vim.g.nord_borders = true
vim.g.nord_contrast = true
vim.cmd('colorscheme nord')
--vim.cmd('colorscheme embark')
--vim.cmd('colorscheme gruvbox-material')
-- Set Leader

View File

@@ -1,47 +1,79 @@
local cmp = require'cmp'
local cmp = require('cmp')
require("luasnip.loaders.from_vscode").lazy_load()
-- Check Tab Completion
local has_words_before = function()
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
cmp.setup({
snippet = {
expand = function(args)
require'luasnip'.lsp_expand(args.body)
end
},
mapping = cmp.mapping.preset.insert({
-- Tab Completion
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
-- Reverse Tab Completion
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s" }),
-- Misc Mappings
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
['<CR>'] = cmp.mapping.confirm({ select = true }),
}),
-- Default Sources
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
}, {
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'buffer' },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
-- Completion - `/` and `?`
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
{ name = 'buffer' },
}
})
-- -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
-- Completion = `:`
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
{ name = 'path' },
{ name = 'cmdline' },
})
})
-- Autopairs
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
cmp.event:on(
'confirm_done',

View File

@@ -9,6 +9,5 @@ require('lsp-lines-config')
require('lualine-config')
require('noice-config')
require('numb-config')
require('nvim-tree-config')
require('telescope-config')
require('ts-config')

View File

@@ -1,12 +1,7 @@
local nix_vars = require("nix-vars")
local nvim_lsp = require('lspconfig')
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap=true, silent=true, buffer=bufnr }
@@ -27,16 +22,20 @@ local on_attach = function(client, bufnr)
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
end
-- Define LSP Flags & Capabilities
local lsp_flags = {
debounce_text_changes = 150,
}
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Python LSP Configuration
nvim_lsp.pyright.setup{
on_attach = on_attach,
flags = lsp_flags,
capabilities = capabilities,
}
-- HTML LSP Configuration
nvim_lsp.html.setup{
on_attach = on_attach,
flags = lsp_flags,
@@ -47,6 +46,7 @@ nvim_lsp.html.setup{
}
}
-- Typescript / Javascript LSP Configuration
nvim_lsp.tsserver.setup{
on_attach = on_attach,
flags = lsp_flags,

View File

@@ -1,5 +1,6 @@
require('lualine').setup({
options = {
theme = "OceanicNext",
theme = "nord",
-- theme = "OceanicNext",
}
})

View File

@@ -1,3 +0,0 @@
require('material').setup()
vim.cmd('colorscheme material')
vim.g.material_style = "oceanic"

View File

@@ -1,21 +1,32 @@
require("noice").setup()
-- Noice Doc Scrolling
vim.keymap.set("n", "<c-f>", function()
if not require("noice.lsp").scroll(4) then
return "<c-f>"
end
end, { silent = true, expr = true })
vim.keymap.set("n", "<c-b>", function()
if not require("noice.lsp").scroll(-4) then
return "<c-b>"
end
end, { silent = true, expr = true })
-- Noice Setup
require("noice").setup({
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
["cmp.entry.get_documentation"] = false,
},
signature = {
enabled = false,
},
},
presets = {
-- bottom_search = false, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = true, -- add a border to hover docs and signature help
},
popupmenu = {
enabled = true,
backend = 'cmp',
lsp_doc_border = false, -- add a border to hover docs and signature help
},
})

View File

@@ -1 +0,0 @@
require("nvim-tree").setup()

View File

@@ -1,4 +1,15 @@
require('telescope').setup()
require('telescope').setup {
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
}
}
}
require('telescope').load_extension('fzf')
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})