diff --git a/lua/mappings/lua.lua b/lua/mappings/lua.lua index dc4df5a..aa3b5df 100644 --- a/lua/mappings/lua.lua +++ b/lua/mappings/lua.lua @@ -9,11 +9,9 @@ end -- copy any selected text with pressing y map("", "c", '"+y') +-- OPEN TERMINALS -- +map("n", "", [[vnew term://bash ]], opt) -- open term over right +map("n", "", [[ split term://bash | resize 10 ]], opt) -- open term bottom --- OPEN TERMINALS -- - --- split term vertically , over the right -map("n", "", [[vnew term://bash ]], opt) - --- split term vertically , over the right -map("n", "", [[ split term://bash | resize 10 ]], opt) +-- COPY EVERYTHING -- +map("n", "", [[ %y+]], opt) diff --git a/lua/nvim-compe/lua.lua b/lua/nvim-compe/lua.lua index df6b263..0eb539c 100644 --- a/lua/nvim-compe/lua.lua +++ b/lua/nvim-compe/lua.lua @@ -43,6 +43,7 @@ local check_back_space = function() end end +-- tab completion _G.tab_complete = function() if vim.fn.pumvisible() == 1 then diff --git a/lua/nvim-lspconfig/lua.lua b/lua/nvim-lspconfig/lua.lua index b77f9e8..304d7fd 100644 --- a/lua/nvim-lspconfig/lua.lua +++ b/lua/nvim-lspconfig/lua.lua @@ -1,42 +1,45 @@ vim.cmd [[packadd nvim-lspconfig]] vim.cmd [[packadd nvim-compe]] -local nvim_lsp = require('lspconfig') + +local nvim_lsp = require("lspconfig") + function on_attach(client) + local function buf_set_keymap(...) + vim.api.nvim_buf_set_keymap(bufnr, ...) + end + local function buf_set_option(...) + vim.api.nvim_buf_set_option(bufnr, ...) + end + buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") - local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + -- Mappings. + local opts = {noremap = true, silent = true} + buf_set_keymap("n", "gD", "lua vim.lsp.buf.declaration()", opts) + buf_set_keymap("n", "gd", "lua vim.lsp.buf.definition()", opts) + buf_set_keymap("n", "K", "lua vim.lsp.buf.hover()", opts) + buf_set_keymap("n", "gi", "lua vim.lsp.buf.implementation()", opts) + buf_set_keymap("n", "", "lua vim.lsp.buf.signature_help()", opts) + buf_set_keymap("n", "wa", "lua vim.lsp.buf.add_workspace_folder()", opts) + buf_set_keymap("n", "wr", "lua vim.lsp.buf.remove_workspace_folder()", opts) + buf_set_keymap("n", "wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", opts) + buf_set_keymap("n", "D", "lua vim.lsp.buf.type_definition()", opts) + buf_set_keymap("n", "rn", "lua vim.lsp.buf.rename()", opts) + buf_set_keymap("n", "gr", "lua vim.lsp.buf.references()", opts) + buf_set_keymap("n", "e", "lua vim.lsp.diagnostic.show_line_diagnostics()", opts) + buf_set_keymap("n", "[d", "lua vim.lsp.diagnostic.goto_prev()", opts) + buf_set_keymap("n", "]d", "lua vim.lsp.diagnostic.goto_next()", opts) + buf_set_keymap("n", "q", "lua vim.lsp.diagnostic.set_loclist()", opts) - buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') + -- Set some keybinds conditional on server capabilities + if client.resolved_capabilities.document_formatting then + buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) + elseif client.resolved_capabilities.document_range_formatting then + buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) + end +end - -- Mappings. - local opts = { noremap=true, silent=true } - buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) - buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) - buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) - buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) - buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) - buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) - buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) - buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) - buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) - buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) - - -- Set some keybinds conditional on server capabilities - if client.resolved_capabilities.document_formatting then - buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) - elseif client.resolved_capabilities.document_range_formatting then - buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) - end - -end - -local servers = { "tsserver", "cssls", "pyls", "html" } +local servers = {"tsserver", "cssls", "pyls", "html"} for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup { on_attach = on_attach } -end \ No newline at end of file + nvim_lsp[lsp].setup {on_attach = on_attach} +end diff --git a/lua/nvimTree/lua.lua b/lua/nvimTree/lua.lua index 4ec583e..34e671f 100644 --- a/lua/nvimTree/lua.lua +++ b/lua/nvimTree/lua.lua @@ -2,27 +2,29 @@ vim.cmd [[packadd nvim-tree.lua]] vim.o.termguicolors = true -vim.g.nvim_tree_side = "left" -vim.g.nvim_tree_width = 25 -vim.g.nvim_tree_ignore = {".git", "node_modules", ".cache"} -vim.g.nvim_tree_auto_open = 0 -vim.g.nvim_tree_auto_close = 0 -vim.g.nvim_tree_quit_on_open = 0 -vim.g.nvim_tree_follow = 1 -vim.g.nvim_tree_indent_markers = 1 -vim.g.nvim_tree_hide_dotfiles = 1 -vim.g.nvim_tree_git_hl = 1 -vim.g.nvim_tree_root_folder_modifier = ":~" -vim.g.nvim_tree_tab_open = 1 -vim.g.nvim_tree_allow_resize = 1 +local g = vim.g -vim.g.nvim_tree_show_icons = { +g.nvim_tree_side = "left" +g.nvim_tree_width = 25 +g.nvim_tree_ignore = {".git", "node_modules", ".cache"} +g.nvim_tree_auto_open = 0 +g.nvim_tree_auto_close = 0 +g.nvim_tree_quit_on_open = 0 +g.nvim_tree_follow = 1 +g.nvim_tree_indent_markers = 1 +g.nvim_tree_hide_dotfiles = 1 +g.nvim_tree_git_hl = 1 +g.nvim_tree_root_folder_modifier = ":~" +g.nvim_tree_tab_open = 1 +g.nvim_tree_allow_resize = 1 + +g.nvim_tree_show_icons = { git = 1, folders = 1, files = 1 } -vim.g.nvim_tree_icons = { +g.nvim_tree_icons = { default = " ", symlink = " ", git = { @@ -55,7 +57,7 @@ vim.api.nvim_set_keymap( } ) -vim.g.nvim_tree_bindings = { +g.nvim_tree_bindings = { [""] = get_lua_cb("edit"), ["o"] = get_lua_cb("edit"), ["<2-LeftMouse>"] = get_lua_cb("edit"), diff --git a/lua/pluginsList/lua.lua b/lua/pluginsList/lua.lua index a4f894d..e400346 100644 --- a/lua/pluginsList/lua.lua +++ b/lua/pluginsList/lua.lua @@ -1,6 +1,7 @@ -- check if packer is installed (~/local/share/nvim/site/pack) local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]]) +-- add { } , when the plugin needs a different branch, loading the plugin with certain commands return require("packer").startup( function() use {"wbthomason/packer.nvim", opt = true} diff --git a/lua/statusline/lua.lua b/lua/statusline/lua.lua index 63a5267..9096a9e 100644 --- a/lua/statusline/lua.lua +++ b/lua/statusline/lua.lua @@ -1,6 +1,7 @@ local gl = require("galaxyline") local gls = gl.section -gl.short_line_list = {" "} + +gl.short_line_list = {" "} -- keeping this table { } as empty will show inactive statuslines local colors = { bg = "#282c34", @@ -31,7 +32,7 @@ gls.left[1] = { } gls.left[2] = { - ViMode = { + statusIcon = { provider = function() return "  " end, @@ -168,7 +169,7 @@ gls.right[3] = { } gls.right[4] = { - SiMode = { + ViMode = { provider = function() local alias = { n = "NORMAL", diff --git a/lua/telescope-nvim/lua.lua b/lua/telescope-nvim/lua.lua index 460298f..b338935 100644 --- a/lua/telescope-nvim/lua.lua +++ b/lua/telescope-nvim/lua.lua @@ -60,7 +60,7 @@ local opt = {noremap = true, silent = true} vim.g.mapleader = " " --- mappings +-- mappings vim.api.nvim_set_keymap("n", "ff", [[lua require('telescope.builtin').find_files()]], opt) vim.api.nvim_set_keymap( "n", @@ -68,9 +68,8 @@ vim.api.nvim_set_keymap( [[lua require('telescope').extensions.media_files.media_files()]], opt ) + vim.api.nvim_set_keymap("n", "fb", [[lua require('telescope.builtin').buffers()]], opt) vim.api.nvim_set_keymap("n", "fh", [[lua require('telescope.builtin').help_tags()]], opt) vim.api.nvim_set_keymap("n", "fo", [[lua require('telescope.builtin').oldfiles()]], opt) vim.api.nvim_set_keymap("n", "fm", [[ Neoformat]], opt) - -vim.api.nvim_set_keymap("n", "", [[ %y+]], opt)