1
0

8 Commits

7 changed files with 29 additions and 14 deletions

7
.gitmodules vendored Normal file
View File

@@ -0,0 +1,7 @@
[submodule "pack/plugins/start/nvim-treesitter"]
path = pack/plugins/start/nvim-treesitter
url = https://github.com/nvim-treesitter/nvim-treesitter
[submodule "pack/plugins/start/mini.nvim"]
path = pack/plugins/start/mini.nvim
url = https://github.com/echasnovski/mini.nvim.git
branch = stable

View File

@@ -3,7 +3,8 @@ vim.api.nvim_exec2('language POSIX', {})
-- }}}
-- Source plugins if they exist {{{
pcall(require, 'plugins')
pcall(require, 'mini-pick')
pcall(require, 'treesitter')
-- }}}
-- General Editor Settings {{{
@@ -15,15 +16,11 @@ vim.opt.shiftwidth = 4
vim.opt.expandtab = false
vim.opt.list = true
vim.opt.listchars:append 'space:·'
vim.opt.path:append '**'
vim.opt.path:append '.'
vim.opt.wildmenu = true
vim.opt.wrap = false
vim.opt.clipboard = 'unnamedplus'
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.updatetime = 250
vim.opt.timeoutlen = 300
vim.opt.inccommand = 'split'
vim.opt.foldmethod = 'marker'
-- }}}
@@ -47,7 +44,7 @@ end, { nargs = 1 })
-- }}}
-- Statusbar {{{
vim.opt.statusline = ' #%n %f %h%w%m%r %= %y %l:%c %p%% '
vim.opt.statusline = ' #%n %f %h%w%m%r %= %{&fileformat} %y %l:%c %p%% '
-- }}}
-- Toggle Terminal Script {{{
@@ -56,20 +53,20 @@ local term_winid = nil
local function openTerminal()
if vim.fn.bufexists(term_buf) ~= 1 then
vim.api.nvim_command("autocmd TermOpen * setlocal nonumber norelativenumber signcolumn=no")
vim.api.nvim_command("split | wincmd J | resize 10 | term")
vim.api.nvim_command('autocmd TermOpen * setlocal nonumber norelativenumber signcolumn=no')
vim.api.nvim_command('split | wincmd J | resize 10 | term')
term_winid = vim.fn.win_getid()
term_buf = vim.fn.bufnr('%')
elseif vim.fn.win_gotoid(term_winid) ~= 1 then
vim.api.nvim_command("sbuffer " .. term_buf .. "| wincmd J | resize 10")
vim.api.nvim_command('sbuffer ' .. term_buf .. '| wincmd J | resize 10')
term_winid = vim.fn.win_getid()
end
vim.api.nvim_command("startinsert")
vim.api.nvim_command('startinsert')
end
local function hideTerminal()
if vim.fn.win_gotoid(term_winid) == 1 then
vim.api.nvim_command("hide")
vim.api.nvim_command('hide')
end
end
@@ -93,9 +90,10 @@ vim.api.nvim_create_autocmd({ 'TermOpen' }, {
vim.keymap.set('n', '<F6>', ':b#<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<F7>', ':bprevious<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<F8>', ':bnext<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>f', ':find ', { noremap = true })
vim.keymap.set('n', '<leader>f', ':Pick files<CR>', { noremap = true })
vim.keymap.set('n', '<leader>g', ':Pick grep_live<CR>', { noremap = true })
vim.keymap.set('n', '<leader>b', ':Pick buffers<CR>', { noremap = true })
vim.keymap.set('n', '<leader>t', ToggleTerminal)
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>')
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>')
vim.keymap.set('n', 'x', '"_x')
vim.keymap.set('n', '<leader>b', ':buffers<CR>:buffer ', { noremap = true, silent = true })
-- }}}

1
lua/mini-pick.lua Normal file
View File

@@ -0,0 +1 @@
require('mini.pick').setup()

6
lua/treesitter.lua Normal file
View File

@@ -0,0 +1,6 @@
require('nvim-treesitter.install').prefer_git = true
require('nvim-treesitter.configs').setup {
auto_install = true,
highlight = { enable = true },
indent = { enable = true }
}

1
submodules.nu Normal file
View File

@@ -0,0 +1 @@
git submodule update --init --remote --recursive