-
Notifications
You must be signed in to change notification settings - Fork 631
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
0 parents
commit 33eee9a
Showing
13 changed files
with
456 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,11 @@ | ||
|
||
function ColorMyPencils(color) | ||
color = color or "rose-pine" | ||
vim.cmd.colorscheme(color) | ||
|
||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) | ||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) | ||
|
||
end | ||
|
||
ColorMyPencils() |
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>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,12 @@ | ||
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,46 @@ | ||
local lsp = require("lsp-zero") | ||
|
||
lsp.preset("recommended") | ||
|
||
lsp.ensure_installed({ | ||
'tsserver', | ||
'eslint', | ||
'sumneko_lua', | ||
'rust_analyzer', | ||
}) | ||
|
||
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(), | ||
}) | ||
|
||
lsp.set_preferences({ | ||
sign_icons = { } | ||
}) | ||
|
||
lsp.setup_nvim_cmp({ | ||
mapping = cmp_mappings | ||
}) | ||
|
||
lsp.on_attach(function(client, bufnr) | ||
local opts = {buffer = bufnr, remap = false} | ||
|
||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) | ||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) | ||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts) | ||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts) | ||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) | ||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) | ||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts) | ||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts) | ||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts) | ||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts) | ||
end) | ||
|
||
lsp.setup() | ||
|
||
|
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 @@ | ||
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) | ||
|
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,23 @@ | ||
require'nvim-treesitter.configs'.setup { | ||
-- A list of parser names, or "all" | ||
ensure_installed = { "help", "javascript", "typescript", "c", "lua", "rust" }, | ||
|
||
-- 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,2 @@ | ||
require("theprimeagen") | ||
|
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 @@ | ||
require("theprimeagen.set") | ||
require("theprimeagen.remap") | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,53 @@ | ||
-- This file can be loaded by calling `lua require('plugins')` from your init.vim | ||
|
||
-- Only required if you have packer configured as `opt` | ||
vim.cmd [[packadd packer.nvim]] | ||
|
||
return require('packer').startup(function(use) | ||
-- Packer can manage itself | ||
use 'wbthomason/packer.nvim' | ||
|
||
use { | ||
'nvim-telescope/telescope.nvim', tag = '0.1.0', | ||
-- or , branch = '0.1.x', | ||
requires = { {'nvim-lua/plenary.nvim'} } | ||
} | ||
|
||
use({ | ||
'rose-pine/neovim', | ||
as = 'rose-pine', | ||
config = function() | ||
vim.cmd('colorscheme rose-pine') | ||
end | ||
}) | ||
|
||
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'}, | ||
} | ||
} | ||
|
||
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,48 @@ | ||
|
||
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") | ||
|
||
vim.keymap.set("n", "<leader>vwm", function() | ||
require("vim-with-me").StartVimWithMe() | ||
end) | ||
vim.keymap.set("n", "<leader>svwm", function() | ||
require("vim-with-me").StopVimWithMe() | ||
end) | ||
|
||
-- greatest remap ever | ||
vim.keymap.set("x", "<leader>p", "\"_dP") | ||
|
||
-- next greatest remap ever : asbjornHaland | ||
vim.keymap.set("n", "<leader>y", "\"+y") | ||
vim.keymap.set("v", "<leader>y", "\"+y") | ||
vim.keymap.set("n", "<leader>Y", "\"+Y") | ||
|
||
vim.keymap.set("n", "<leader>d", "\"_d") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
vim.keymap.set("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", function() | ||
vim.lsp.buf.format() | ||
end) | ||
|
||
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,36 @@ | ||
vim.opt.guicursor = "" | ||
|
||
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 = false | ||
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" | ||
|
||
vim.g.mapleader = " " | ||
|
||
|
||
|
Oops, something went wrong.
What does this do? As best as I can tell underscore is not a register. Thank you 🙇