Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Bałazy authored and Marcin Bałazy committed Aug 5, 2023
1 parent a7e468d commit 5e713b5
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 84 deletions.
101 changes: 46 additions & 55 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ vim.cmd("set number relativenumber")
lvim.format_on_save = false
lvim.leader = "space"

lvim.colorscheme = "onedark"
lvim.colorscheme = "tokyodark"

require('onedark').setup {
style = 'darker'
Expand All @@ -14,19 +14,25 @@ vim.opt.scrolloff = 16

lvim.builtin.terminal.active = true
lvim.builtin.nvimtree.side = "left"
lvim.builtin.nvimtree.setup.view.width = 54

-- lvim.builtin.nvimtree.setup.view.width = 54

lvim.builtin.nvimtree.setup.view.float.enable = true
lvim.builtin.nvimtree.setup.view.float.open_win_config.width = 110
lvim.builtin.nvimtree.setup.view.float.open_win_config.height = 40
lvim.builtin.nvimtree.setup.view.float.open_win_config.col = 20
lvim.builtin.nvimtree.setup.view.float.open_win_config.row = 3

lvim.builtin.nvimtree.setup.reload_on_bufenter = true
lvim.builtin.nvimtree.setup.auto_reload_on_write = true

-- lvim.builtin.nvimtree.setup.actions.open_file.quit_on_open = true
require("telescope").load_extension("persisted")

-- lvim.builtin.treesitter.highlight.enabled = true
-- lvim.builtin.treesitter.autotag.enable = true
lvim.builtin.treesitter.autotag.enable = true
lvim.builtin.treesitter.rainbow.enable = true



lvim.builtin.alpha.dashboard.section.buttons.entries = {
{ "c", lvim.icons.ui.Fire .. " Current Sessions", "<CMD>SessionLoad<CR>" },
{ "s", lvim.icons.ui.Code .. " Sessions", "<CMD>Telescope persisted<CR>" },
Expand All @@ -37,22 +43,37 @@ lvim.builtin.alpha.dashboard.section.buttons.entries = {
{ "t", lvim.icons.ui.FindText .. " Find Text", "<CMD>Telescope live_grep<CR>" },
}

local rainbow = require 'ts-rainbow'

require("nvim-treesitter.configs").setup({
rainbow = {
enable = true,
-- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for
-- extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
-- colors = {}, -- table of hex strings
query = {
'rainbow-parens'
},
strategy = rainbow.strategy.global,
hlgroups = {
'TSRainbowRed',
'TSRainbowYellow',
'TSRainbowBlue',
'TSRainbowOrange',
'TSRainbowGreen',
'TSRainbowViolet',
'TSRainbowCyan'
},
}
})

require('telescope').setup({

require("telescope").setup {
extensions = {
persisted = {
layout_config = { width = 0.55, height = 0.55 }
}
}
})
file_browser = {
grouped = true,
display_stat = { date = false, size = false, mode = false },
},
},
}

require("telescope").load_extension "file_browser"

require("persisted").setup({
save_dir = vim.fn.expand(vim.fn.stdpath("data") .. "/sessions/"), -- directory where session files are saved
Expand All @@ -72,8 +93,7 @@ require("persisted").setup({

lvim.builtin.telescope.defaults.prompt_prefix = ""
lvim.builtin.telescope.defaults.selection_caret = ">"
lvim.builtin.telescope.defaults.layout_config.width = 0.9
lvim.builtin.telescope.defaults.file_ignore_patterns = { "NvimTree", "node_modules", ".yarn" }
-- lvim.builtin.telescope.defaults.file_ignore_patterns = { "NvimTree", ".yarn" }

local components = require("lvim.core.lualine.components")

Expand All @@ -96,47 +116,18 @@ vim.api.nvim_create_autocmd("BufEnter", {
end,
})

require("indent_blankline").setup({
filetype = { "yaml", "yml" },
show_current_context = false,
show_trailing_blankline_indent = false,
})

-- load snippets
require("luasnip.loaders.from_vscode").lazy_load({ paths = { "./snippets/" } })

require("typescript").setup({})
require("linters")
require("which")
require("cmpMappings")

lvim.plugins = {
{
"nvim-telescope/telescope-file-browser.nvim",
},
{
"SmiteshP/nvim-gps",
dependencies = "nvim-treesitter/nvim-treesitter",
},
{
"olimorris/persisted.nvim",
config = true
},
{
"navarasu/onedark.nvim",
},
{
"jose-elias-alvarez/typescript.nvim",
},
{ "tpope/vim-surround" },
{
"windwp/nvim-ts-autotag",
event = "InsertEnter",
},
{
"p00f/nvim-ts-rainbow",
},
-- { "Pocco81/DAPInstall.nvim", branch = "dev" },
{ "David-Kunz/jester" },
-- { "rcarriga/nvim-dap-ui" },
}

require("indent_blankline").setup({
filetype = { "yaml", "yml" },
show_current_context = false,
show_trailing_blankline_indent = false,
})
require("linters")
require("which")
require("plugins")
13 changes: 8 additions & 5 deletions lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,26 @@
"nvim-navic": { "branch": "master", "commit": "83dc174da915f9dbc9b51169e9b62a2e0d42b527" },
"nvim-tree.lua": { "branch": "master", "commit": "bb375fb20327c49920c41d2b51c1ce2f4fe7deb3" },
"nvim-treesitter": { "branch": "master", "commit": "2ce3c9080cfe4a39c7907e672edafd2a95244a7c" },
"nvim-ts-autotag": { "branch": "main", "commit": "40615e96075c743ef47aaf9de966dc348bec6459" },
"nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "0bf8fbc2ca8f8cdb6efbd0a9e32740d7a991e4c3" },
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
"nvim-ts-rainbow2": { "branch": "master", "commit": "b3120cd5ae9ca524af9cb602f41e12e301fa985f" },
"nvim-web-devicons": { "branch": "master", "commit": "986875b7364095d6535e28bd4aac3a9357e91bbe" },
"onedark.nvim": { "branch": "master", "commit": "462b45758ea94ff30ad48979268094590a6b7b7e" },
"onedark.nvim": { "branch": "master", "commit": "cae5fdf035ee92c407a29ee2ccfcff503d2be7f1" },
"onedarker.nvim": { "branch": "freeze", "commit": "b00dd2189f264c5aeb4cf04c59439655ecd573ec" },
"persisted.nvim": { "branch": "main", "commit": "c384aa67067200001938338e8d32cb4261c99ba4" },
"persisted.nvim": { "branch": "main", "commit": "c1c4bbff8a4e9b9f66812b2daa9d3338916e8da2" },
"plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" },
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
"schemastore.nvim": { "branch": "main", "commit": "0b396f538f195c249f021a48c3d8988f0d3f86f7" },
"structlog.nvim": { "branch": "main", "commit": "45b26a2b1036bb93c0e83f4225e85ab3cee8f476" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "87dfaa9a9c251388cf4f01b9d4078c29d1fc8803" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "6fe423eea6604c2fcbb906ff5f7e27f748a6ed87" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "9de317bdea2bc393074651179c4fc7f93e9b2d56" },
"toggleterm.nvim": { "branch": "main", "commit": "68fdf851c2b7901a7065ff129b77d3483419ddce" },
"tokyodark.nvim": { "branch": "master", "commit": "4bfb42924274abc5de9f5f4779075b77c6112c85" },
"tokyonight.nvim": { "branch": "main", "commit": "c5df636ce62a8aab7565f35da143cfd672526302" },
"typescript.nvim": { "branch": "main", "commit": "5b3680e5c386e8778c081173ea0c978c14a40ccb" },
"trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" },
"typescript.nvim": { "branch": "main", "commit": "de304087e6e49981fde01af8ccc5b21e8519306f" },
"vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"which-key.nvim": { "branch": "main", "commit": "4acffc92953a90a790603bfdab7c92319ab167b1" }
Expand Down
43 changes: 43 additions & 0 deletions lua/plugins.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
lvim.plugins = {
{
"nvim-telescope/telescope-file-browser.nvim",
},
{
"SmiteshP/nvim-gps",
dependencies = "nvim-treesitter/nvim-treesitter",
},
{
"olimorris/persisted.nvim",
config = true
},
{
"HiPhish/nvim-ts-rainbow2",
},
{
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
},
{
"navarasu/onedark.nvim",
},
{
"jose-elias-alvarez/typescript.nvim",
},
{ "tpope/vim-surround" },
{
"windwp/nvim-ts-autotag",
event = "InsertEnter",
},
{
'tiagovla/tokyodark.nvim'
},
{
"p00f/nvim-ts-rainbow",
},
{ "David-Kunz/jester" },
}
40 changes: 16 additions & 24 deletions lua/which.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ lvim.builtin.which_key.mappings.l.R = { "<cmd>TypescriptRenameFile<cr>", "Change
lvim.builtin.which_key.mappings.l.c = { "<cmd>TypescriptRemoveUnused<cr>", "Remove unused imports" }
lvim.builtin.which_key.mappings.l.F = { "<cmd>TypescriptFixAll<cr>", "Fix all" }
lvim.builtin.which_key.mappings.l.d = { "<cmd>TypescriptGoToSourceDefinition<cr>", "Go to source definition" }
lvim.builtin.which_key.mappings.l.g = { "<cmd>TermExec go_back=0 cmd='rf-lerna release' size=10 direction=horizontal <cr>", "rf-lerna release" }
lvim.builtin.which_key.mappings.l.t = { "<cmd>ToggleTerm size=20 direction=horizontal <cr>", "Toggle term" }
-- lvim.builtin.which_key.mappings.l.h = { "<cmd>TSLspToggleInlayHints<cr>", "Toggle hints" }

-- Buffers hjkl
Expand Down Expand Up @@ -62,20 +64,19 @@ lvim.builtin.which_key.mappings["t"] = {
-- Search
lvim.builtin.which_key.mappings.s.q = { "<cmd>Telescope quickfix<cr>", "Quickfix list" }
lvim.builtin.which_key.mappings.s.f = { "<cmd>Telescope live_grep<cr>", "Grep files" }
lvim.builtin.which_key.mappings.s.r = { "<cmd>Telescope lsp_references<cr>", "Grep References" }
lvim.builtin.which_key.mappings.s.F = { "<cmd>Telescope find_files<cr>", "Find files" }
lvim.builtin.which_key.mappings.s.m = { "<cmd>Telescope marks<cr>", "Marks" }
lvim.builtin.which_key.mappings.s.e = { "<cmd>Telescope file_browser<cr>", "File browser" }
lvim.builtin.which_key.mappings.s.E = { "<cmd>Telescope file_browser path=%:p:h select_buffer=true<cr>",
"File browser cur" }
lvim.builtin.which_key.mappings.s.B = { "<cmd>Telescope current_buffer_fuzzy_find<cr>", "Grep current buffer" }
lvim.builtin.which_key.mappings.s.b = { "<cmd>Telescope buffers<cr>", "Find buffer" }
lvim.builtin.which_key.mappings.s.s = { "<cmd>Telescope buffers<cr>", "Find buffer" }
-- lvim.builtin.which_key.mappings.s.s = { "<cmd>Telescope persisted<cr>", "Grep sessions" }
lvim.builtin.which_key.mappings.s.p = { "<cmd>Telescope projects<cr>", "Find in projects" }
lvim.builtin.which_key.mappings.s.s = { "<cmd>Telescope persisted<cr>", "Grep strig" }
lvim.builtin.which_key.mappings.s.S = { "<cmd>Telescope grep_string<cr>", "Grep strig" }
lvim.builtin.which_key.mappings.s.j = {
"<cmd>lua require 'telescope'.extensions.file_browser.file_browser()<cr><cr>",
"File browser",
}
lvim.builtin.which_key.mappings.s.t = nil
lvim.builtin.which_key.mappings.s.k = nil
-- lvim.builtin.which_key.mappings.s.k = nil

-- LunarVim
-- lvim.builtin.which_key.mappings.L.q = { "<cmd>NvimTreeRefresh<cr>", "Refresh NvimTree" }
Expand All @@ -91,6 +92,7 @@ lvim.builtin.which_key.mappings["v"] = {
-- Git
lvim.builtin.which_key.mappings.g.o = { "<cmd>Telescope git_status<cr>", "Git status" }
lvim.builtin.which_key.mappings.g.S = { "<cmd>lua require 'gitsigns'.stage_buffer()<cr><cr>", "Stage Buffer" }
lvim.builtin.which_key.mappings.g.a = { "<cmd>TermExec go_back=0 cmd='gh run watch' size=20 direction=horizontal <cr>", "gh run watch" }

-- LunarVim keybindings
lvim.keys.normal_mode["("] = "6j"
Expand All @@ -99,13 +101,14 @@ lvim.keys.normal_mode[")"] = "6k"
lvim.builtin.telescope = {
active = true,
defaults = {
layout_strategy = "horizontal",
path_display = { "truncate" },
layout_strategy = "vertical",
layout_config = {
width = 0.99,
height = 0.80,
preview_cutoff = 120,
preview_width = 0.55,
prompt_position = "bottom",
width = 0.66,
height = 0.96,
preview_cutoff = 20,
-- preview_width = 0.5,
prompt_position = "top",
},
},
pickers = {
Expand All @@ -117,14 +120,3 @@ lvim.builtin.telescope = {
},
},
}

-- lvim.builtin.telescope.pickers.git_files = {
-- layout_strategy = "horizontal",
-- layout_config = {
-- width = 0.90,
-- height = 0.80,
-- preview_cutoff = 120,
-- preview_width = 0.6,
-- prompt_position = "bottom",
-- },
-- }

0 comments on commit 5e713b5

Please sign in to comment.