forked from jvscholz/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
still no ff
- Loading branch information
Showing
9 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
vim.g.mapleader = ' ' | ||
|
||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | ||
if not (vim.uv or vim.loop).fs_stat(lazypath) then | ||
vim.fn.system({ | ||
"git", | ||
"clone", | ||
"--filter=blob:none", | ||
"https://github.com/folke/lazy.nvim.git", | ||
"--branch=stable", -- latest stable release | ||
lazypath, | ||
}) | ||
end | ||
vim.opt.rtp:prepend(lazypath) | ||
|
||
require("lazy").setup("j.plugins") | ||
|
||
vim.o.background = "dark" -- or "light" for light mode | ||
vim.cmd([[colorscheme gruvbox]]) | ||
vim.opt.clipboard = 'unnamedplus' | ||
vim.opt.number = true | ||
vim.opt.relativenumber = true | ||
vim.opt.expandtab = true | ||
vim.opt.shiftwidth = 2 | ||
vim.opt.tabstop = 2 | ||
vim.opt.expandtab = true | ||
vim.opt.shiftwidth = 2 | ||
vim.opt.tabstop = 2 | ||
|
||
-- nvim-tree bindings | ||
vim.api.nvim_set_keymap('n', '<leader>e', ':NvimTreeToggle<CR>', { noremap = true, silent = true }) | ||
vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', { noremap = true, silent = true }) | ||
vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', { noremap = true, silent = true }) | ||
vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>k', { noremap = true, silent = true }) | ||
vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', { noremap = true, silent = true }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
return { | ||
'goolord/alpha-nvim', | ||
config = function () | ||
require'alpha'.setup(require'alpha.themes.dashboard'.config) | ||
end, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
return { | ||
'windwp/nvim-autopairs', | ||
event = "InsertEnter", | ||
config = true | ||
-- use opts = {} for passing setup options | ||
-- this is equalent to setup({}) function | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
return { | ||
'numToStr/Comment.nvim', | ||
opts = { | ||
-- add any options here | ||
}, | ||
lazy = false, | ||
config = function() | ||
require('Comment').setup() | ||
end | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
return { | ||
"ellisonleao/gruvbox.nvim", priority = 1000 , config = true | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
return { | ||
{ | ||
'VonHeikemen/lsp-zero.nvim', | ||
branch = 'v3.x', | ||
lazy = true, | ||
config = false, | ||
init = function() | ||
-- Disable automatic setup, we are doing it manually | ||
vim.g.lsp_zero_extend_cmp = 0 | ||
vim.g.lsp_zero_extend_lspconfig = 0 | ||
end, | ||
}, | ||
{ | ||
'williamboman/mason.nvim', | ||
lazy = false, | ||
config = true, | ||
}, | ||
|
||
-- Autocompletion | ||
{ | ||
'hrsh7th/nvim-cmp', | ||
event = 'InsertEnter', | ||
dependencies = { | ||
{'L3MON4D3/LuaSnip'}, | ||
}, | ||
config = function() | ||
-- Here is where you configure the autocompletion settings. | ||
local lsp_zero = require('lsp-zero') | ||
lsp_zero.extend_cmp() | ||
|
||
-- And you can configure cmp even more, if you want to. | ||
local cmp = require('cmp') | ||
local cmp_action = lsp_zero.cmp_action() | ||
|
||
cmp.setup({ | ||
formatting = lsp_zero.cmp_format({details = true}), | ||
mapping = cmp.mapping.preset.insert({ | ||
['<C-Space>'] = cmp.mapping.complete(), | ||
['<C-u>'] = cmp.mapping.scroll_docs(-4), | ||
['<C-d>'] = cmp.mapping.scroll_docs(4), | ||
['<C-f>'] = cmp_action.luasnip_jump_forward(), | ||
['<C-b>'] = cmp_action.luasnip_jump_backward(), | ||
}), | ||
snippet = { | ||
expand = function(args) | ||
require('luasnip').lsp_expand(args.body) | ||
end, | ||
}, | ||
}) | ||
end | ||
}, | ||
|
||
-- LSP | ||
{ | ||
'neovim/nvim-lspconfig', | ||
cmd = {'LspInfo', 'LspInstall', 'LspStart'}, | ||
event = {'BufReadPre', 'BufNewFile'}, | ||
dependencies = { | ||
{'hrsh7th/cmp-nvim-lsp'}, | ||
{'williamboman/mason-lspconfig.nvim'}, | ||
}, | ||
config = function() | ||
-- This is where all the LSP shenanigans will live | ||
local lsp_zero = require('lsp-zero') | ||
lsp_zero.extend_lspconfig() | ||
|
||
--- if you want to know more about lsp-zero and mason.nvim | ||
--- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guides/integrate-with-mason-nvim.md | ||
lsp_zero.on_attach(function(client, bufnr) | ||
-- see :help lsp-zero-keybindings | ||
-- to learn the available actions | ||
lsp_zero.default_keymaps({buffer = bufnr}) | ||
end) | ||
|
||
require('mason-lspconfig').setup({ | ||
ensure_installed = {}, | ||
handlers = { | ||
-- this first function is the "default handler" | ||
-- it applies to every language server without a "custom handler" | ||
function(server_name) | ||
require('lspconfig')[server_name].setup({}) | ||
end, | ||
|
||
-- this is the "custom handler" for `lua_ls` | ||
lua_ls = function() | ||
-- (Optional) Configure lua language server for neovim | ||
local lua_opts = lsp_zero.nvim_lua_ls() | ||
require('lspconfig').lua_ls.setup(lua_opts) | ||
end, | ||
} | ||
}) | ||
end | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
return { | ||
'nvim-lualine/lualine.nvim', | ||
dependencies = { 'nvim-tree/nvim-web-devicons' }, | ||
config = function() | ||
require('lualine').setup { | ||
options = { theme = 'gruvbox_dark' } | ||
} | ||
end | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
return { | ||
"nvim-tree/nvim-tree.lua", | ||
dependencies = { | ||
"nvim-tree/nvim-web-devicons" | ||
}, | ||
config = function() | ||
vim.g.loaded_netrw = 1 | ||
vim.g.loaded_netrwPlugin = 1 | ||
|
||
-- optionally enable 24-bit colour | ||
vim.opt.termguicolors = true | ||
|
||
-- empty setup using defaults | ||
require("nvim-tree").setup() | ||
|
||
-- OR setup with some options | ||
require("nvim-tree").setup({ | ||
sort = { | ||
sorter = "case_sensitive", | ||
}, | ||
view = { | ||
width = 30, | ||
}, | ||
renderer = { | ||
group_empty = true, | ||
}, | ||
filters = { | ||
dotfiles = true, | ||
}, | ||
}) | ||
|
||
require("nvim-tree").setup({ | ||
renderer = { | ||
icons = { | ||
show = { | ||
git = true, | ||
file = false, | ||
folder = false, | ||
folder_arrow = true, | ||
}, | ||
glyphs = { | ||
folder = { | ||
arrow_closed = "⏵", | ||
arrow_open = "⏷", | ||
}, | ||
git = { | ||
unstaged = "✗", | ||
staged = "✓", | ||
unmerged = "⌥", | ||
renamed = "➜", | ||
untracked = "★", | ||
deleted = "⊖", | ||
ignored = "◌", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
end | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
return { | ||
"nvim-treesitter/nvim-treesitter", | ||
build = ":TSUpdate", | ||
config = function () | ||
local configs = require("nvim-treesitter.configs") | ||
|
||
configs.setup({ | ||
ensure_installed = { "c", "lua", "vim", "vimdoc", "rust", "go", "cpp", "javascript", "html" }, | ||
sync_install = false, | ||
highlight = { enable = true }, | ||
indent = { enable = true }, | ||
}) | ||
end | ||
} |