Skip to content

Commit 075f29f

Browse files
committed
my config
1 parent db4867a commit 075f29f

File tree

1 file changed

+129
-107
lines changed

1 file changed

+129
-107
lines changed

init.lua

Lines changed: 129 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,11 @@
1-
--[[
2-
3-
=====================================================================
4-
==================== READ THIS BEFORE CONTINUING ====================
5-
=====================================================================
6-
======== .-----. ========
7-
======== .----------------------. | === | ========
8-
======== |.-""""""""""""""""""-.| |-----| ========
9-
======== || || | === | ========
10-
======== || KICKSTART.NVIM || |-----| ========
11-
======== || || | === | ========
12-
======== || || |-----| ========
13-
======== ||:Tutor || |:::::| ========
14-
======== |'-..................-'| |____o| ========
15-
======== `"")----------------(""` ___________ ========
16-
======== /::::::::::| |::::::::::\ \ no mouse \ ========
17-
======== /:::========| |==hjkl==:::\ \ required \ ========
18-
======== '""""""""""""' '""""""""""""' '""""""""""' ========
19-
======== ========
20-
=====================================================================
21-
=====================================================================
22-
23-
What is Kickstart?
24-
25-
Kickstart.nvim is *not* a distribution.
26-
27-
Kickstart.nvim is a starting point for your own configuration.
28-
The goal is that you can read every line of code, top-to-bottom, understand
29-
what your configuration is doing, and modify it to suit your needs.
30-
31-
Once you've done that, you can start exploring, configuring and tinkering to
32-
make Neovim your own! That might mean leaving Kickstart just the way it is for a while
33-
or immediately breaking it into modular pieces. It's up to you!
34-
35-
If you don't know anything about Lua, I recommend taking some time to read through
36-
a guide. One possible example which will only take 10-15 minutes:
37-
- https://learnxinyminutes.com/docs/lua/
38-
39-
After understanding a bit more about Lua, you can use `:help lua-guide` as a
40-
reference for how Neovim integrates Lua.
41-
- :help lua-guide
42-
- (or HTML version): https://neovim.io/doc/user/lua-guide.html
43-
44-
Kickstart Guide:
45-
46-
TODO: The very first thing you should do is to run the command `:Tutor` in Neovim.
47-
48-
If you don't know what this means, type the following:
49-
- <escape key>
50-
- :
51-
- Tutor
52-
- <enter key>
53-
54-
(If you already know the Neovim basics, you can skip this step.)
55-
56-
Once you've completed that, you can continue working through **AND READING** the rest
57-
of the kickstart init.lua.
58-
59-
Next, run AND READ `:help`.
60-
This will open up a help window with some basic information
61-
about reading, navigating and searching the builtin help documentation.
62-
63-
This should be the first place you go to look when you're stuck or confused
64-
with something. It's one of my favorite Neovim features.
65-
66-
MOST IMPORTANTLY, we provide a keymap "<space>sh" to [s]earch the [h]elp documentation,
67-
which is very useful when you're not exactly sure of what you're looking for.
68-
69-
I have left several `:help X` comments throughout the init.lua
70-
These are hints about where to find more information about the relevant settings,
71-
plugins or Neovim features used in Kickstart.
72-
73-
NOTE: Look for lines like this
74-
75-
Throughout the file. These are for you, the reader, to help you understand what is happening.
76-
Feel free to delete them once you know what you're doing, but they should serve as a guide
77-
for when you are first encountering a few different constructs in your Neovim config.
78-
79-
If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
80-
81-
I hope you enjoy your Neovim journey,
82-
- TJ
83-
84-
P.S. You can delete this when you're done too. It's your config now! :)
85-
--]]
86-
871
-- Set <space> as the leader key
882
-- See `:help mapleader`
893
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
904
vim.g.mapleader = ' '
915
vim.g.maplocalleader = ' '
926

937
-- Set to true if you have a Nerd Font installed and selected in the terminal
94-
vim.g.have_nerd_font = false
8+
vim.g.have_nerd_font = true
959

9610
-- [[ Setting options ]]
9711
-- See `:help vim.opt`
@@ -102,7 +16,7 @@ vim.g.have_nerd_font = false
10216
vim.opt.number = true
10317
-- You can also add relative line numbers, to help with jumping.
10418
-- Experiment for yourself to see if you like it!
105-
-- vim.opt.relativenumber = true
19+
vim.opt.relativenumber = true
10620

10721
-- Enable mouse mode, can be useful for resizing splits for example!
10822
vim.opt.mouse = 'a'
@@ -269,6 +183,43 @@ require('lazy').setup({
269183
-- Then, because we use the `opts` key (recommended), the configuration runs
270184
-- after the plugin has been loaded as `require(MODULE).setup(opts)`.
271185

186+
{
187+
'folke/trouble.nvim',
188+
opts = {}, -- for default options, refer to the configuration section for custom setup.
189+
cmd = 'Trouble',
190+
keys = {
191+
{
192+
'<leader>xx',
193+
'<cmd>Trouble diagnostics toggle<cr>',
194+
desc = 'Diagnostics (Trouble)',
195+
},
196+
{
197+
'<leader>xX',
198+
'<cmd>Trouble diagnostics toggle filter.buf=0<cr>',
199+
desc = 'Buffer Diagnostics (Trouble)',
200+
},
201+
{
202+
'<leader>cs',
203+
'<cmd>Trouble symbols toggle focus=false<cr>',
204+
desc = 'Symbols (Trouble)',
205+
},
206+
{
207+
'<leader>cl',
208+
'<cmd>Trouble lsp toggle focus=false win.position=right<cr>',
209+
desc = 'LSP Definitions / references / ... (Trouble)',
210+
},
211+
{
212+
'<leader>xL',
213+
'<cmd>Trouble loclist toggle<cr>',
214+
desc = 'Location List (Trouble)',
215+
},
216+
{
217+
'<leader>xQ',
218+
'<cmd>Trouble qflist toggle<cr>',
219+
desc = 'Quickfix List (Trouble)',
220+
},
221+
},
222+
},
272223
{ -- Useful plugin to show you pending keybinds.
273224
'folke/which-key.nvim',
274225
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
@@ -388,7 +339,36 @@ require('lazy').setup({
388339
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
389340
-- },
390341
-- },
391-
-- pickers = {}
342+
pickers = {
343+
find_files = {
344+
find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' },
345+
theme = 'ivy',
346+
},
347+
buffers = {
348+
theme = 'ivy',
349+
},
350+
oldfiles = {
351+
theme = 'ivy',
352+
},
353+
live_grep = {
354+
theme = 'ivy',
355+
},
356+
git_files = {
357+
theme = 'ivy',
358+
},
359+
help_tags = {
360+
theme = 'ivy',
361+
},
362+
current_buffer_fuzzy_find = {
363+
theme = 'ivy',
364+
},
365+
grep_string = {
366+
theme = 'ivy',
367+
},
368+
diagnostics = {
369+
theme = 'ivy',
370+
},
371+
},
392372
extensions = {
393373
['ui-select'] = {
394374
require('telescope.themes').get_dropdown(),
@@ -592,14 +572,14 @@ require('lazy').setup({
592572
})
593573

594574
-- Change diagnostic symbols in the sign column (gutter)
595-
-- if vim.g.have_nerd_font then
596-
-- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
597-
-- local diagnostic_signs = {}
598-
-- for type, icon in pairs(signs) do
599-
-- diagnostic_signs[vim.diagnostic.severity[type]] = icon
600-
-- end
601-
-- vim.diagnostic.config { signs = { text = diagnostic_signs } }
602-
-- end
575+
if vim.g.have_nerd_font then
576+
local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
577+
local diagnostic_signs = {}
578+
for type, icon in pairs(signs) do
579+
diagnostic_signs[vim.diagnostic.severity[type]] = icon
580+
end
581+
vim.diagnostic.config { signs = { text = diagnostic_signs } }
582+
end
603583

604584
-- LSP servers and clients are able to communicate to each other what features they support.
605585
-- By default, Neovim doesn't support everything that is in the LSP specification.
@@ -619,16 +599,16 @@ require('lazy').setup({
619599
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
620600
local servers = {
621601
-- clangd = {},
622-
-- gopls = {},
602+
gopls = {},
623603
-- pyright = {},
624-
-- rust_analyzer = {},
604+
rust_analyzer = {},
625605
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
626606
--
627607
-- Some languages (like typescript) have entire language plugins that can be useful:
628608
-- https://github.com/pmizio/typescript-tools.nvim
629609
--
630610
-- But for many setups, the LSP (`ts_ls`) will work just fine
631-
-- ts_ls = {},
611+
ts_ls = {},
632612
--
633613

634614
lua_ls = {
@@ -719,7 +699,7 @@ require('lazy').setup({
719699
-- python = { "isort", "black" },
720700
--
721701
-- You can use 'stop_after_first' to run the first available formatter from the list
722-
-- javascript = { "prettierd", "prettier", stop_after_first = true },
702+
javascript = { 'prettierd', 'prettier', stop_after_first = true },
723703
},
724704
},
725705
},
@@ -845,13 +825,20 @@ require('lazy').setup({
845825
-- change the command in the config to whatever the name of that colorscheme is.
846826
--
847827
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
848-
'folke/tokyonight.nvim',
828+
'rose-pine/nvim',
849829
priority = 1000, -- Make sure to load this before all the other start plugins.
830+
config = function(self, opts)
831+
require('rose-pine').setup {
832+
styles = {
833+
transparency = true,
834+
},
835+
}
836+
end,
850837
init = function()
851838
-- Load the colorscheme here.
852839
-- Like many other themes, this one has different styles, and you could load
853840
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
854-
vim.cmd.colorscheme 'tokyonight-night'
841+
vim.cmd.colorscheme 'rose-pine-moon'
855842

856843
-- You can configure highlights by doing something like:
857844
vim.cmd.hi 'Comment gui=none'
@@ -934,11 +921,46 @@ require('lazy').setup({
934921
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
935922
--
936923
-- require 'kickstart.plugins.debug',
937-
-- require 'kickstart.plugins.indent_line',
938-
-- require 'kickstart.plugins.lint',
939-
-- require 'kickstart.plugins.autopairs',
924+
require 'kickstart.plugins.indent_line',
925+
require 'kickstart.plugins.lint',
926+
require 'kickstart.plugins.autopairs',
940927
-- require 'kickstart.plugins.neo-tree',
941-
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
928+
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
929+
930+
{
931+
'alexghergh/nvim-tmux-navigation',
932+
config = function()
933+
require('nvim-tmux-navigation').setup {
934+
enable_git_status = true,
935+
enable_diagnostics = true,
936+
close_if_last_window = true,
937+
disable_when_zoomed = true, -- defaults to false
938+
keybindings = {
939+
left = '<C-h>',
940+
down = '<C-j>',
941+
up = '<C-k>',
942+
right = '<C-l>',
943+
last_active = '<C-\\>',
944+
next = '<C->>',
945+
},
946+
filesystem = {
947+
filtered_items = {
948+
visible = true,
949+
-- show_hidden_count = true,
950+
hide_dotfiles = false,
951+
hide_gitignored = false,
952+
hide_by_name = {
953+
'.git',
954+
'.DS_Store',
955+
'thumbs.db',
956+
},
957+
never_show = {},
958+
},
959+
follow_current_file = true,
960+
},
961+
}
962+
end,
963+
},
942964

943965
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
944966
-- This is the easiest way to modularize your config.

0 commit comments

Comments
 (0)