···88 fileencoding = 'utf-8', -- the encoding written to a file
99 hlsearch = true, -- highlight all matches on previous search pattern
1010 ignorecase = true, -- ignore case in search patterns
1111- mouse = 'nv', -- allow the mouse to be used in neovim (not in insert mode)
1111+ mouse = '', -- don't allow the mouse to be used in neovim
1212 pumheight = 10, -- pop up menu height
1313 showmode = false, -- we don't need to see things like -- INSERT -- anymore
1414- showtabline = 1, -- only show tab if there are at least two tab pages
1414+ showtabline = 2, -- always show tabs
1515 smartcase = true, -- smart case
1616 smartindent = true, -- make indenting smarter again
1717 splitbelow = true, -- force all horizontal splits to go below current window
···2020 termguicolors = true, -- set term gui colors (most terminals support this)
2121 timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
2222 undofile = true, -- enable persistent undo
2323- updatetime = 100, -- faster completion (4000ms default)
2323+ updatetime = 300, -- faster completion (4000ms default)
2424 writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
2525 expandtab = true, -- convert tabs to spaces
2626 shiftwidth = 2, -- the number of spaces inserted for each indentation
2727 tabstop = 2, -- insert 2 spaces for a tab
2828 cursorline = true, -- highlight the current line
2929 number = true, -- set numbered lines
3030- relativenumber = true, -- set relative numbered lines
3030+ relativenumber = false, -- set relative numbered lines
3131 numberwidth = 2, -- set number column width to 2 {default 4}
3232 signcolumn = 'yes', -- always show the sign column, otherwise it would shift the text each time
3333 colorcolumn = '80',
+3-10
nvim/lua/core/plugins.lua
···1414 install_path,
1515 }
1616 print 'Installing packer close and reopen Neovim...'
1717- vim.cmd.packadd('packer.nvim')
1717+ vim.cmd [[packadd packer.nvim]]
1818end
19192020-- Autocommand that reloads neovim whenever you save the plugins.lua file
···5252 use 'numToStr/Comment.nvim' -- Easily comment stuff
5353 use 'kyazdani42/nvim-web-devicons'
5454 use 'kyazdani42/nvim-tree.lua' -- File explorer written in lua
5555- -- use 'akinsho/bufferline.nvim'
5555+ use 'akinsho/bufferline.nvim'
5656 use 'nvim-lualine/lualine.nvim'
5757 use 'goolord/alpha-nvim'
5858 use 'ahmedkhalf/project.nvim'
···6363 use 'lukas-reineke/indent-blankline.nvim'
6464 use 'SmiteshP/nvim-navic'
6565 use 'ChristianChiarulli/nvim-gps'
6666-6767- -- TODO: need to make this work correctly
6868- use 'Pocco81/true-zen.nvim'
69667067 -- Note
7168 use 'nvim-neorg/neorg'
···7976 -- Terminal
8077 use {
8178 'akinsho/toggleterm.nvim',
8282- tag = 'v2.*',
7979+ tag = 'v1.*',
8380 }
84818582 -- Colorschemes
8683 use 'folke/tokyonight.nvim'
8787- use { 'catppuccin/nvim', as = 'catppuccin' }
88848985 -- cmp plugins
9086 use 'hrsh7th/nvim-cmp' -- The completion plugin
···108104 -- Language specific plugins (doesn't depend on nvim-lspconfg)
109105 use 'akinsho/flutter-tools.nvim' -- flutter
110106 use 'smjonas/inc-rename.nvim' -- rename with immediate visual feedback
111111- use 'j-hui/fidget.nvim' -- lsp progress message
112112- use 'simrat39/inlay-hints.nvim' -- inlay type hints
113107114108 -- Telescope
115109 use 'nvim-telescope/telescope.nvim'
116116- use 'zane-/cder.nvim'
117110118111 -- Treesitter
119112 use {
-97
nvim/lua/core/terminal.lua
···11-local termbufs = {}
22-33-local augroup = vim.api.nvim_create_augroup('terminal', { clear = true })
44-local function newBuf(opts)
55- opts = opts or {}
66- opts.cmd = opts.cmd or vim.o.shell
77-88- local buf = vim.api.nvim_create_buf(true, false)
99- -- vim.bo[buf].buflisted = false
1010- vim.bo[buf].filetype = 'term'
1111- vim.api.nvim_buf_call(buf, function()
1212- vim.fn.termopen(opts.cmd, {
1313- detach = 1,
1414- on_exit = function()
1515- -- if opts.autoclose then
1616- -- vim.api.nvim_buf_delete(buf, {})
1717- -- end
1818- end,
1919- })
2020- end)
2121-2222- -- Edit buffer name (add bufnr)
2323- local name = vim.api.nvim_buf_get_name(buf)
2424- name = name .. '#' .. buf
2525- vim.api.nvim_buf_set_name(buf, name)
2626-2727- -- Save terminal-buffer's bufnr
2828- table.insert(termbufs, {
2929- bufnr = buf,
3030- })
3131- vim.api.nvim_create_autocmd('BufDelete', {
3232- group = augroup,
3333- buffer = buf,
3434- callback = function()
3535- for i, term in ipairs(termbufs) do
3636- if term.bufnr == buf then
3737- table.remove(termbufs, i)
3838- end
3939- end
4040- end
4141- })
4242- return buf
4343-end
4444-4545-function _G.term(opts)
4646- if type(opts) == 'string' then
4747- opts = { cmd = opts }
4848- end
4949- local buf = newBuf(opts)
5050- vim.cmd.tabnew()
5151- vim.api.nvim_set_current_buf(buf)
5252- vim.api.nvim_buf_call(buf, function()
5353- -- vim.cmd.setlocal('norenu')
5454- -- vim.opt_local.signcolumn = 'no'
5555- -- vim.opt_local.number = false
5656- -- vim.opt_local.relativenumber = false
5757- end)
5858- -- local win = vim.api.nvim_get_current_win()
5959- -- vim.wo[win].signcolumn = 'no'
6060- -- vim.wo[win].number = false
6161- -- vim.wo[win].relativenumber = false
6262-end
6363-6464-function _G.select_buf()
6565- vim.ui.select(termbufs,
6666- {
6767- prompt = 'Select LuaTerm Buffers',
6868- format_item = function(item)
6969- return item.bufnr .. ' - ' .. (item.name or 'No Name Terminal')
7070- end,
7171- },
7272- function(choice)
7373- if choice then
7474- vim.api.nvim_set_current_buf(choice.bufnr)
7575- end
7676- end)
7777-end
7878-7979-vim.keymap.set('n', '<c-t>', term)
8080-vim.keymap.set('n', '<c-p>', function()
8181- print(vim.inspect(termbufs))
8282-end)
8383-8484--- handle closing with autocmds
8585-8686--- <C-;><leader> -> open luaterm buffer here (using telescope)
8787--- <C-;>; -> switch to luaterm buffer (using telescope)
8888---
8989--- open or switch current terminal buffer window to
9090--- <C-;>t -> open terminal buffer in new tab
9191--- <C-;>f -> open terminal buffer in floating window
9292---
9393--- Telescope format
9494---
9595--- bufnr | terminal_name
9696--- +
9797--- [[New Terminal]]
···2323 cpp = { 'g++ -o temp ', ' && ./temp && rm ./temp' },
2424}
2525local function Runfile()
2626- -- vim.cmd.write()
2626+ -- vim.cmd [[w]]
2727 local cmds = files[vim.bo.filetype]
2828 local command = cmds[1] .. vim.fn.expand('%:t') .. cmds[2]
2929 if command ~= nil then
···4646 return vim.o.columns * 0.4
4747 end
4848 end,
4949- direction = 'float',
5049 open_mapping = [[<c-t>]],
5150 on_open = function(term)
5251 local opts = { buffer = term.bufnr }
+1-1
nvim/lua/plugins/treesitter/context.lua
···22if not ok then return end
3344context.setup {
55- enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
55+ enable = false, -- Enable this plugin (Can be enabled/disabled later via commands)
66 max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
77 patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries.
88 -- For all filetypes
+14-13
nvim/lua/plugins/whichkey.lua
···44which_key.setup({
55 plugins = {
66 presets = {
77- operators = false,
77+ operators = true,
88 motions = false,
99 text_objects = false,
1010 windows = false,
···4141local mappings = {
4242 ['0'] = { 'Select Next Parameter' },
4343 ['9'] = { 'Select Prev Parameter' },
4444- [';'] = {
4545- name = 'Terminal',
4646- ['1'] = { '<cmd>1ToggleTerm<CR>', '1' },
4747- ['2'] = { '<cmd>2ToggleTerm<CR>', '2' },
4848- ['3'] = { '<cmd>3ToggleTerm<CR>', '3' },
4949- ['4'] = { '<cmd>4ToggleTerm<CR>', '4' },
5050- f = { '<cmd>ToggleTerm direction=float<CR>', 'Float Terminal' },
5151- },
4444+ [';'] = { '<cmd>Telescope commands<CR>', 'Commands' },
52455346 a = { '<cmd>Alpha<CR>', 'Alpha' },
5447 b = { '<cmd>Telescope buffers<CR>', 'Buffers' },
5555- -- c = { '<cmd>Telescope commands<CR>', 'Commands' },
5648 f = {
5749 name = 'File',
5850 f = { '<cmd>Telescope find_files<CR>', 'Find in CWD' },
···6254 },
6355 g = {
6456 name = 'Git',
5757+ -- TODO: add way to go-to-next-git-block
6558 j = { '<cmd>Gitsigns next_hunk<CR>', 'Go To Next Hunk' },
6659 k = { '<cmd>Gitsigns prev_hunk<CR>', 'Go To Prev Hunk' },
6767- r = { '<cmd>Gitsigns reset_hunk<CR>', 'Reset Hunk' },
6868- t = { '<cmd>Gitsigns toggle_signs<CR>', 'Toggle signs' },
6960 s = { '<cmd>Telescope git_status<CR>', 'Status' },
7061 d = { '<cmd>DiffviewOpen<CR>', 'Diff view' },
7162 l = { '<cmd>lua _Lazygit_toggle()<CR>', 'LazyGit' },
···9182 r = { vim.lsp.buf.rename, 'Rename' },
9283 w = { '<cmd>TroubleToggle workspace_diagnostics<CR>', 'Workspace Diagnostics' },
9384 },
9494- q = { 'Smart Close' },
8585+ q = { '<cmd>close<CR>', 'Close Window' },
8686+ ['<leader>'] = {
8787+ name = 'Terminal',
8888+ ['1'] = { '<cmd>1ToggleTerm<CR>', '1' },
8989+ ['2'] = { '<cmd>2ToggleTerm<CR>', '2' },
9090+ ['3'] = { '<cmd>3ToggleTerm<CR>', '3' },
9191+ ['4'] = { '<cmd>4ToggleTerm<CR>', '4' },
9292+ f = { '<cmd>ToggleTerm direction=float<CR>', 'Float Terminal' },
9393+ },
9494+ -- TODO: delete buffer if bufnr(0) is -1 or it is last window(except NvimTree, Trouble, ...) istead of closing window
9595+ q = { 'Close Window' },
9596 t = {
9697 name = 'Trouble',
9798 w = { '<cmd>TroubleToggle workspace_diagnostics<CR>', 'Workspace Diagnostics' },