mirror of
https://github.com/Nickiel12/nicks-nix-config.git
synced 2024-11-24 13:45:29 -08:00
Compare commits
2 commits
4c415ebe51
...
4d4e59a430
Author | SHA1 | Date | |
---|---|---|---|
4d4e59a430 | |||
|
b4ceee780c |
2 changed files with 128 additions and 24 deletions
|
@ -12,7 +12,7 @@
|
|||
tls = true;
|
||||
tls_starttls = true;
|
||||
auth = true;
|
||||
from = "noreply@nickiel.net";
|
||||
from = "nickiel.is.a.dev@gmail.com";
|
||||
user = "nickiel.is.a.dev";
|
||||
passwordeval = "cat /Aurora/mail.password";
|
||||
};
|
||||
|
|
|
@ -1,36 +1,43 @@
|
|||
-- Put in ~/AppData/Local/nvim
|
||||
|
||||
vim.opt.signcolumn = 'yes';
|
||||
vim.opt.scrolloff = 8;
|
||||
vim.opt.autoindent = true;
|
||||
vim.opt.expandtab = true;
|
||||
vim.opt.foldlevel = 20;
|
||||
vim.opt.foldmethod = "expr";
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()";
|
||||
vim.opt.foldenable = true; -- Disable folding at startup.
|
||||
vim.opt.number = true;
|
||||
vim.opt.shiftwidth = 4;
|
||||
vim.opt.tabstop = 4;
|
||||
|
||||
|
||||
vim.g.mapleader = ' ';
|
||||
|
||||
|
||||
vim.keymap.set("v", ">", ">gv");
|
||||
vim.keymap.set("v", "<", "<gv");
|
||||
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv");
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv");
|
||||
|
||||
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz");
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz");
|
||||
|
||||
|
||||
vim.keymap.set("n", "n", "nzzzv");
|
||||
vim.keymap.set("n", "N", "Nzzzv");
|
||||
|
||||
|
||||
vim.keymap.set("x", "<leader>p", "\"_dP");
|
||||
vim.keymap.set("n", "<leader>y", "\"+y");
|
||||
vim.keymap.set("v", "<leader>y", "\"+y");
|
||||
vim.keymap.set("n", "<leader>Y", "\"+Y");
|
||||
|
||||
vim.keymap.set("v", ">", ">gv");
|
||||
vim.keymap.set("v", "<", "<gv");
|
||||
|
||||
|
||||
vim.keymap.set("n", "<leader>d", "\"_d");
|
||||
vim.keymap.set("v", "<leader>d", "\"_d");
|
||||
|
||||
|
||||
vim.keymap.set("n", "<leader>.", "<cmd>Telescope find_files<cr>")
|
||||
vim.keymap.set("n", "<leader>o.", "<cmd>Telescope file_browser<cr>")
|
||||
vim.keymap.set("n", "<leader>of", "<cmd>Telescope live_grep<cr>")
|
||||
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
|
@ -43,13 +50,12 @@ if not vim.loop.fs_stat(lazypath) then
|
|||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Use a protected call so we don't error out on first use
|
||||
local status_ok, lazy = pcall(require, 'lazy')
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
lazy.setup({
|
||||
spec = {
|
||||
-- Colorscheme:
|
||||
|
@ -58,10 +64,10 @@ lazy.setup({
|
|||
'tanvirtin/monokai.nvim', lazy = false,
|
||||
priority = 1000, -- make sure to load this before all the other start plugins
|
||||
},
|
||||
|
||||
|
||||
-- Treesitter
|
||||
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
||||
|
||||
|
||||
-- Autopair
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
|
@ -70,17 +76,17 @@ lazy.setup({
|
|||
require('nvim-autopairs').setup{}
|
||||
end
|
||||
},
|
||||
|
||||
|
||||
-- init.lua:
|
||||
{
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.5',
|
||||
-- or , branch = '0.1.x',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' }
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
-- LSP
|
||||
{ 'neovim/nvim-lspconfig' },
|
||||
|
||||
|
||||
-- Autocomplete
|
||||
{
|
||||
'hrsh7th/nvim-cmp',
|
||||
|
@ -96,11 +102,109 @@ lazy.setup({
|
|||
'saadparwaiz1/cmp_luasnip',
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
vim.cmd([[colorscheme monokai_pro]])
|
||||
|
||||
|
||||
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
vim.opt.completeopt = "menu,menuone,noselect"
|
||||
|
||||
local cmp = require 'cmp'
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down
|
||||
-- C-b (back) C-f (forward) for snippet placeholder navigation.
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = 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' }),
|
||||
}),
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
},
|
||||
}
|
||||
|
||||
-- require("autoclose").setup()
|
||||
require 'nvim-treesitter.install'.compilers = { 'zig' }
|
||||
|
||||
vim.api.nvim_create_autocmd('BufWinEnter', {
|
||||
pattern = '?*',
|
||||
callback = function()
|
||||
vim.cmd('normal! zX')
|
||||
vim.cmd('silent! loadview')
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- Setup language servers.
|
||||
local lspconfig = require('lspconfig')
|
||||
lspconfig.pyright.setup {}
|
||||
lspconfig.html.setup {}
|
||||
lspconfig.cssls.setup {}
|
||||
lspconfig.eslint.setup {}
|
||||
lspconfig.tsserver.setup {}
|
||||
lspconfig.rust_analyzer.setup {
|
||||
-- Server-specific settings. See `:help lspconfig-setup`
|
||||
settings = {
|
||||
['rust-analyzer'] = {},
|
||||
},
|
||||
}
|
||||
--Enable (broadcasting) snippet capability for completion
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
require'lspconfig'.cssls.setup {
|
||||
}
|
||||
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
ensure_installed = { "cpp", "lua", "vim", "html", "javascript", "rust", "go", "sql", "c_sharp" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = false,
|
||||
|
||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue