config/nvim/init.lua (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
require 'plugins' require 'options' require 'keymaps' require 'completion' require 'lsp' -- TODO move each plugin setup to own file local function nvim_tree_on_attach(bufnr) local api = require('nvim-tree.api') local function opts(desc) return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } end api.config.mappings.default_on_attach(bufnr) vim.keymap.set('n', 't', api.node.open.tab, opts('Open: New Tab')) vim.keymap.set('n', '<C-s>', api.node.open.horizontal, opts('Open: Horizontal Split')) end require("nvim-tree").setup({ on_attach = nvim_tree_on_attach, sort_by = "case_sensitive", filters = { custom = {"__pycache__"} }, diagnostics = { enable = true }, renderer = { indent_markers = { enable = false }, icons = { show = { file = false, folder = false, }, git_placement = "after", glyphs = { git = { unstaged = "△", staged = "✔", unmerged = "", renamed = "➜", untracked = "★", deleted = "✗", ignored = "◌", } } } }, }) require('telescope').setup { defaults = { mappings = { i = { ['<Esc>'] = require('telescope.actions').close, ['<C-j>'] = require('telescope.actions').move_selection_next, ['<C-k>'] = require('telescope.actions').move_selection_previous, } }, }, pickers = { find_files = { previewer = false, layout_config = { width = {0.5, max=80, min=60} } }, buffers = { previewer = false, layout_config = { width = {0.5, max=80, min=60} } }, }, extensions = { fzf = { fuzzy = true, -- false will only do exact matching override_generic_sorter = true, override_file_sorter = true, case_mode = "smart_case", -- or "ignore_case" or "respect_case" -- the default case_mode is "smart_case" } } } require('telescope').load_extension('fzf') -- require'nvim-treesitter.configs'.setup { -- ensure_installed = { "python", "hcl", "json", "go", "lua", "javascript", "typescript", "html", "css", "c", "cpp", "rust" }, -- sync_install = false, -- auto_install = true, -- -- ignore_install = { "javascript" }, -- highlight = { -- enable = true, -- disable = { "help"}, -- -- 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 = true, -- }, -- indent = { -- enable = false, -- disable = {"hcl", "python"} -- } -- } -- TODO move to seperate autocmd file vim.cmd ([[ autocmd FileType html,javascript,lua,typescript,yaml setlocal ts=2 sts=2 sw=2 autocmd FileType hcl setlocal ts=2 sts=2 sw=2 autocmd BufRead *jsx setlocal sw=2 autocmd BufRead *tsx setlocal sw=2 ]]) |