local js_based_languages = { "typescript", "javascript", "typescriptreact", "javascriptreact" } local option = vim.opt local keymap = vim.keymap local telescope = require("telescope.builtin") local autotag = require("nvim-ts-autotag").setup() --Basic Editor Setup option.nu = true option.tabstop = 2 option.softtabstop = 2 option.shiftwidth = 2 option.expandtab = true option.smartindent = true option.wrap = false option.swapfile = false option.hlsearch = false option.incsearch = true option.updatetime = 50 option.laststatus = 0 option.signcolumn = "number" option.autoindent = true option.clipboard = "unnamedplus" option.termguicolors = true -- Setup Editor Theme vim.cmd.colorscheme("tokyonight") vim.cmd([[ highlight GitGutterAdd ctermbg=none highlight GitGutterAdd guibg=none highlight Normal ctermbg=none highlight Normal guibg=none highlight signcolumn ctermbg=none highlight signcolumn guibg=none highlight StatusLine ctermbg=none highlight StatusLine guibg=none highlight DiagnosticError ctermbg=none highlight DiagnosticError guibg=none highlight DiagnosticWarn ctermbg=none highlight DiagnosticWarn guibg=none highlight DiagnosticInfo ctermbg=none highlight DiagnosticInfo guibg=none highlight DiagnosticHint ctermbg=none highlight DiagnosticHint guibg=none highlight DiagnosticVirtualError ctermbg=none highlight DiagnosticVirtualError guibg=none highlight DiagnosticVirtualWarn ctermbg=none highlight DiagnosticVirtualWarn guibg=none highlight DiagnosticVirtualInfo ctermbg=none highlight DiagnosticVirtualInfo guibg=none highlight DiagnosticVirtualHint ctermbg=none highlight DiagnosticVirtualHint guibg=none highlight DiagnosticVirtualTextError ctermbg=none highlight DiagnosticVirtualTextError guibg=none highlight DiagnosticVirtualTextWarn ctermbg=none highlight DiagnosticVirtualTextWarn guibg=none highlight DiagnosticVirtualTextInfo ctermbg=none highlight DiagnosticVirtualTextInfo guibg=none highlight DiagnosticVirtualTextHint ctermbg=none highlight DiagnosticVirtualTextHint guibg=none ]]) -- run specific commands after different file extensions vim.cmd([[ augroup RunPfOnSave autocmd! autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write % autocmd BufWritePost *.tex silent! :VimtexCompile autocmd BufWritePost *.md silent! :MarkdownPreview autocmd BufWritePost *.php silent! !php-cs-fixer fix % augroup END ]]) -- Gui options vim.o.guifont = "Fira Code:h7" vim.g.vimtex_view_method = "zathura" vim.g.vimtex_compiler_method = "latexrun" vim.g.gitgutter_set_sign_backgrounds = 1 --Keybinds vim.g.mapleader = " " keymap.set("n", "e", vim.cmd.Ex) keymap.set("n", "f", telescope.find_files, {}) keymap.set("n", "fg", telescope.live_grep, {}) keymap.set("n", "fb", telescope.buffers, {}) keymap.set("n", "fh", telescope.help_tags, {}) keymap.set("n", "s", [[:%s/\<\>//gI]]) keymap.set("n", "a", "ggVG") keymap.set("v", "J", ":m '>+1gv=gv") keymap.set("v", "K", ":m '<-2gv=gv") --Treesitter require("nvim-treesitter.configs").setup({ ensure_installed = { "javascript", "typescript", "rust", "c", "lua", "vim" }, sync_install = false, auto_install = true, highlight = { enable = true, }, })