-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34ff29d
commit 2bae0ed
Showing
15 changed files
with
291 additions
and
4 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
File renamed without changes.
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,2 @@ | ||
vim.o.background = "dark" -- or "light" for light mode | ||
vim.cmd([[colorscheme gruvbox]]) |
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 @@ | ||
vim.keymap.set('n', '<leader>gs', vim.cmd.Git) |
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 @@ | ||
local mark = require('harpoon.mark') | ||
local ui = require('harpoon.ui') | ||
|
||
vim.keymap.set('n', '<leader>a', mark.add_file) | ||
vim.keymap.set('n', '<C-e>', ui.toggle_quick_menu) | ||
|
||
vim.keymap.set('n', '<C-h>', function () ui.nav_file(1) end) | ||
vim.keymap.set('n', '<C-t>', function () ui.nav_file(2) end) | ||
vim.keymap.set('n', '<C-n>', function () ui.nav_file(3) end) | ||
vim.keymap.set('n', '<C-s>', function () ui.nav_file(4) 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,76 @@ | ||
local lsp = require("lsp-zero") | ||
|
||
lsp.preset("recommended") | ||
|
||
lsp.ensure_installed({ | ||
'tsserver', | ||
'eslint', | ||
'sumneko_lua', | ||
'rust_analyzer', | ||
}) | ||
|
||
-- Fix Undefined global 'vim' | ||
lsp.configure('sumneko_lua', { | ||
settings = { | ||
Lua = { | ||
diagnostics = { | ||
globals = { 'vim' } | ||
} | ||
} | ||
} | ||
}) | ||
|
||
|
||
local cmp = require('cmp') | ||
local cmp_select = {behavior = cmp.SelectBehavior.Select} | ||
local cmp_mappings = lsp.defaults.cmp_mappings({ | ||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), | ||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select), | ||
['<C-y>'] = cmp.mapping.confirm({ select = true }), | ||
["<C-Space>"] = cmp.mapping.complete(), | ||
}) | ||
|
||
-- disable completion with tab | ||
-- this helps with copilot setup | ||
cmp_mappings['<Tab>'] = nil | ||
cmp_mappings['<S-Tab>'] = nil | ||
|
||
lsp.setup_nvim_cmp({ | ||
mapping = cmp_mappings | ||
}) | ||
|
||
lsp.set_preferences({ | ||
suggest_lsp_servers = false, | ||
sign_icons = { | ||
error = 'E', | ||
warn = 'W', | ||
hint = 'H', | ||
info = 'I' | ||
} | ||
}) | ||
|
||
lsp.on_attach(function(client, bufnr) | ||
local opts = {buffer = bufnr, remap = false} | ||
|
||
if client.name == "eslint" then | ||
vim.cmd.LspStop('eslint') | ||
return | ||
end | ||
|
||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) | ||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) | ||
vim.keymap.set("n", "<leader>vws", vim.lsp.buf.workspace_symbol, opts) | ||
vim.keymap.set("n", "<leader>vd", vim.diagnostic.open_float, opts) | ||
vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts) | ||
vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts) | ||
vim.keymap.set("n", "<leader>vca", vim.lsp.buf.code_action, opts) | ||
vim.keymap.set("n", "<leader>vrr", vim.lsp.buf.references, opts) | ||
vim.keymap.set("n", "<leader>vrn", vim.lsp.buf.rename, opts) | ||
vim.keymap.set("i", "<C-h>", vim.lsp.buf.signature_help, opts) | ||
end) | ||
|
||
lsp.setup() | ||
|
||
vim.diagnostic.config({ | ||
virtual_text = 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,10 @@ | ||
local builtin = require('telescope.builtin') | ||
vim.keymap.set('n', '<leader>pf', builtin.find_files, {}) | ||
vim.keymap.set('n', '<C-p>', builtin.git_files, {}) | ||
vim.keymap.set('n', '<leader>ps', function() | ||
builtin.grep_string({ search = vim.fn.input("Grep > ") }); | ||
end) | ||
|
||
vim.keymap.set('n', '<leader>ag', builtin.live_grep, {}) | ||
|
||
vim.keymap.set('n', '<leader>b', builtin.buffers, {}) |
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,22 @@ | ||
require'nvim-treesitter.configs'.setup { | ||
-- A list of parser names, or "all" | ||
ensure_installed = { "help", "c", "lua", "rust", "javascript", "typescript", "go", "vim"}, | ||
|
||
-- 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 = true, | ||
|
||
highlight = { | ||
-- `false` will disable the whole extension | ||
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, | ||
}, | ||
} |
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,2 @@ | ||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle) | ||
|
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,3 @@ | ||
require("./llago") | ||
|
||
print("hello from init.lua") |
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,3 @@ | ||
require("llago.remap") | ||
require("llago.packer") | ||
require("llago.set") |
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,61 @@ | ||
local ensure_packer = function() | ||
local fn = vim.fn | ||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' | ||
if fn.empty(fn.glob(install_path)) > 0 then | ||
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) | ||
vim.cmd [[packadd packer.nvim]] | ||
return true | ||
end | ||
return false | ||
end | ||
|
||
local packer_bootstrap = ensure_packer() | ||
|
||
return require('packer').startup(function(use) | ||
use 'wbthomason/packer.nvim' | ||
use { | ||
'nvim-telescope/telescope.nvim', tag = '0.1.0', | ||
-- or , branch = '0.1.x', | ||
requires = { {'nvim-lua/plenary.nvim'} } | ||
} | ||
|
||
use { "ellisonleao/gruvbox.nvim" } | ||
|
||
use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) | ||
use('nvim-treesitter/playground') | ||
use('ThePrimeagen/harpoon') | ||
use('mbbill/undotree') | ||
use('tpope/vim-fugitive') | ||
use { | ||
'VonHeikemen/lsp-zero.nvim', | ||
requires = { | ||
-- LSP Support | ||
{'neovim/nvim-lspconfig'}, | ||
{'williamboman/mason.nvim'}, | ||
{'williamboman/mason-lspconfig.nvim'}, | ||
|
||
-- Autocompletion | ||
{'hrsh7th/nvim-cmp'}, | ||
{'hrsh7th/cmp-buffer'}, | ||
{'hrsh7th/cmp-path'}, | ||
{'saadparwaiz1/cmp_luasnip'}, | ||
{'hrsh7th/cmp-nvim-lsp'}, | ||
{'hrsh7th/cmp-nvim-lua'}, | ||
|
||
-- Snippets | ||
{'L3MON4D3/LuaSnip'}, | ||
{'rafamadriz/friendly-snippets'}, | ||
} | ||
} | ||
|
||
|
||
-- My plugins here | ||
-- use 'foo1/bar1.nvim' | ||
-- use 'foo2/bar2.nvim' | ||
|
||
-- Automatically set up your configuration after cloning packer.nvim | ||
-- Put this at the end after all plugins | ||
if packer_bootstrap then | ||
require('packer').sync() | ||
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,33 @@ | ||
vim.g.mapleader = "," | ||
|
||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex) | ||
|
||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") | ||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") | ||
|
||
vim.keymap.set("n", "J", "mzJ`z") | ||
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") | ||
|
||
-- greatest remap ever | ||
vim.keymap.set("x", "<leader>p", [["_dP]]) | ||
|
||
-- next greatest remap ever : asbjornHaland | ||
vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]]) | ||
vim.keymap.set("n", "<leader>Y", [["+Y]]) | ||
|
||
vim.keymap.set({ "n", "v" }, "<leader>d", [["_d]]) | ||
|
||
vim.keymap.set("n", "Q", "<nop>") | ||
vim.keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>") | ||
vim.keymap.set("n", "<leader>f", vim.lsp.buf.format) | ||
|
||
vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz") | ||
vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz") | ||
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz") | ||
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz") | ||
|
||
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]]) | ||
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { 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,30 @@ | ||
vim.opt.nu = true | ||
--vim.opt.relativenumber = true | ||
|
||
vim.opt.tabstop = 4 | ||
vim.opt.softtabstop = 4 | ||
vim.opt.shiftwidth = 4 | ||
vim.opt.expandtab = true | ||
|
||
vim.opt.smartindent = true | ||
|
||
vim.opt.wrap = false | ||
|
||
vim.opt.swapfile = false | ||
vim.opt.backup = false | ||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" | ||
vim.opt.undofile = true | ||
|
||
vim.opt.hlsearch = true | ||
vim.opt.incsearch = true | ||
|
||
vim.opt.termguicolors = true | ||
|
||
vim.opt.scrolloff = 8 | ||
vim.opt.signcolumn = "yes" | ||
vim.opt.isfname:append("@-@") | ||
|
||
vim.opt.updatetime = 50 | ||
|
||
vim.opt.colorcolumn = "80" | ||
|
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,33 @@ | ||
|
||
vim.keymap.set({"n", "v"}, "<leader>y", [["+y]]) | ||
vim.keymap.set("n", "<leader>Y", [["+Y]]) | ||
vim.keymap.set({"n", "v"}, "<leader>d", [["_d]]) | ||
|
||
-- This is going to get me cancelled | ||
vim.keymap.set("i", "<C-c>", "<Esc>") | ||
|
||
vim.keymap.set("n", "Q", "<nop>") | ||
vim.keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>") | ||
vim.keymap.set("n", "<leader>f", vim.lsp.buf.format) | ||
|
||
vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz") | ||
vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz") | ||
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz") | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled | ||
-- This is going to get me cancelled |