diff --git a/.gitmodules b/.gitmodules index d9859e0..964b638 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "nvim/pack/nvim/start/nvim-lspconfig"] path = nvim/pack/nvim/start/nvim-lspconfig url = https://github.com/neovim/nvim-lspconfig.git +[submodule "nvim/pack/packer/start/cmp-buffer"] + path = nvim/pack/packer/start/cmp-buffer + url = https://github.com/hrsh7th/cmp-buffer.git diff --git a/kitty/kitty.conf b/kitty/kitty.conf index 5d4feaf..378089b 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -1,332 +1,32 @@ -# vim:fileencoding=utf-8:foldmethod=marker font_family "FiraCode Nerd Font Mono" -# bold_font auto -# italic_font auto -# bold_italic_font auto font_size 12.0 -# force_ltr no -# symbol_map -# narrow_symbols -# disable_ligatures never -# font_features -# modify_font -# box_drawing_scale 0.001, 1, 1.5, 2 -# undercurl_style thin-sparse -# text_composition_strategy platform -# text_fg_override_threshold 0 cursor #cccccc -# cursor_text_color #111111 -# cursor_shape block -# cursor_beam_thickness 1.5 -# cursor_underline_thickness 2.0 -# cursor_blink_interval -1 -# cursor_stop_blinking_after 15.0 scrollback_lines -1 -# scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER -# scrollback_pager_history_size 0 -# scrollback_fill_enlarged_window no -# wheel_scroll_multiplier 5.0 -# wheel_scroll_min_lines 1 -# touch_scroll_multiplier 1.0 -# mouse_hide_wait 3.0 -# url_color #0087bd -# url_style curly -# open_url_with default -# url_prefixes file ftp ftps gemini git gopher http https irc ircs kitty mailto news sftp ssh -# detect_urls yes -# url_excluded_characters -# show_hyperlink_targets no -# underline_hyperlinks hover -# copy_on_select no -# paste_actions quote-urls-at-prompt,confirm -# strip_trailing_spaces never -# select_by_word_characters @-./_~?&=%+# -# select_by_word_characters_forward -# click_interval -1.0 -# focus_follows_mouse no -# pointer_shape_when_grabbed arrow -# default_pointer_shape beam -# pointer_shape_when_dragging beam -# clear_all_mouse_actions no -# mouse_map left click ungrabbed mouse_handle_click selection link prompt -# mouse_map shift+left click grabbed,ungrabbed mouse_handle_click selection link prompt -# mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_handle_click link -# mouse_map ctrl+shift+left press grabbed discard_event -# mouse_map middle release ungrabbed paste_from_selection -# mouse_map left press ungrabbed mouse_selection normal -# mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle -# mouse_map left doublepress ungrabbed mouse_selection word -# mouse_map left triplepress ungrabbed mouse_selection line -# mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point -# mouse_map right press ungrabbed mouse_selection extend -# mouse_map shift+middle release ungrabbed,grabbed paste_selection -# mouse_map shift+middle press grabbed discard_event -# mouse_map shift+left press ungrabbed,grabbed mouse_selection normal -# mouse_map ctrl+shift+alt+left press ungrabbed,grabbed mouse_selection rectangle -# mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word -# mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line -# mouse_map ctrl+shift+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point -# mouse_map shift+right press ungrabbed,grabbed mouse_selection extend -# mouse_map ctrl+shift+right press ungrabbed mouse_show_command_output -# repaint_delay 10 -# input_delay 3 -# sync_to_monitor yes +sync_to_monitor yes enable_audio_bell no visual_bell_duration 0 -# visual_bell_color none window_alert_on_bell no bell_on_tab "🔔 " -# command_on_bell none -# bell_path none -# linux_bell_theme __custom remember_window_size no -initial_window_width 800 -initial_window_height 600 -# enabled_layouts * -# window_resize_step_cells 2 -# window_resize_step_lines 2 +initial_window_width 1205 +initial_window_height 920 window_border_width 0 -# draw_minimal_borders yes window_margin_width 0 single_window_margin_width -1 window_padding_width 0 single_window_padding_width -1 -# placement_strategy center -# active_border_color #00ff00 -# inactive_border_color #cccccc -# bell_border_color #ff5a00 -# inactive_text_alpha 1.0 -# hide_window_decorations no -# window_logo_path none -# window_logo_position bottom-right -# window_logo_alpha 0.5 -# resize_debounce_time 0.1 0.5 -# resize_in_steps no -# visual_window_select_characters 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ -# confirm_os_window_close -1 -# tab_bar_edge bottom -# tab_bar_margin_width 0.0 -# tab_bar_margin_height 0.0 0.0 -# tab_bar_style separator +placement_strategy center tab_bar_style powerline -# tab_bar_align left tab_bar_min_tabs 1 -# tab_switch_strategy previous -# tab_fade 0.25 0.5 0.75 1 tab_separator " | " -# tab_powerline_style angled -# tab_activity_symbol none -# tab_title_max_length 0 tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{index}: {title}" -# active_tab_title_template none -# active_tab_foreground #000 -# active_tab_background #eee active_tab_font_style bold-italic -# inactive_tab_foreground #444 -# inactive_tab_background #999 -# inactive_tab_font_style normal -# tab_bar_background none -# tab_bar_margin_color none #: Color scheme {{{ include monokai.conf #: }}} -# foreground #dddddd -# background #000000 -# background_opacity 0.9 -# background_blur 1 -# background_image none -# background_image_layout tiled -# background_image_linear no -# dynamic_background_opacity no -# background_tint 0.0 -# background_tint_gaps 1.0 -# dim_opacity 0.4 -# selection_foreground #000000 -# selection_background #fffacd -# color0 #000000 -# color8 #767676 -# color1 #cc0403 -# color9 #f2201f -# color2 #19cb00 -# color10 #23fd00 -# color3 #cecb00 -# color11 #fffd00 -# color4 #0d73cc -# color12 #1a8fff -# color5 #cb1ed1 -# color13 #fd28ff -# color6 #0dcdcd -# color14 #14ffff -# color7 #dddddd -# color15 #ffffff -# mark1_foreground black -# mark1_background #98d3cb -# mark2_foreground black -# mark2_background #f2dcd3 -# mark3_foreground black -# mark3_background #f274bc -# shell . -# editor . -# close_on_child_death no -# remote_control_password allow_remote_control yes -# listen_on none -# env -# watcher -# exe_search_path -# update_check_interval 24 -# startup_session none -# clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask -# clipboard_max_size 512 -# file_transfer_confirmation_bypass -# allow_hyperlinks yes -# shell_integration enabled -# allow_cloning ask -# clone_source_strategies venv,conda,env_var,path -# notify_on_cmd_finish never -# term xterm-kitty -# forward_stdio no -# menu_map wayland_titlebar_color system -# macos_titlebar_color system -# macos_option_as_alt no -# macos_hide_from_tasks no -# macos_quit_when_last_window_closed no -# macos_window_resizable yes -# macos_thicken_font 0 -# macos_traditional_fullscreen no -# macos_show_window_title_in all -# macos_menubar_title_max_length 0 -# macos_custom_beam_cursor no -# macos_colorspace srgb -# linux_display_server auto -# kitty_mod ctrl+shift -# clear_all_shortcuts no -# action_alias -# kitten_alias -# map kitty_mod+c copy_to_clipboard -# map cmd+c copy_to_clipboard -# map kitty_mod+v paste_from_clipboard -# map cmd+v paste_from_clipboard -# map kitty_mod+s paste_from_selection -# map shift+insert paste_from_selection -# map kitty_mod+o pass_selection_to_program -# map kitty_mod+up scroll_line_up -# map kitty_mod+k scroll_line_up -# map opt+cmd+page_up scroll_line_up -# map cmd+up scroll_line_up -# map kitty_mod+down scroll_line_down -# map kitty_mod+j scroll_line_down -# map opt+cmd+page_down scroll_line_down -# map cmd+down scroll_line_down -# map kitty_mod+page_up scroll_page_up -# map cmd+page_up scroll_page_up -# map kitty_mod+page_down scroll_page_down -# map cmd+page_down scroll_page_down -# map kitty_mod+home scroll_home -# map cmd+home scroll_home -# map kitty_mod+end scroll_end -# map cmd+end scroll_end -# map kitty_mod+z scroll_to_prompt -1 -# map kitty_mod+x scroll_to_prompt 1 -# map kitty_mod+h show_scrollback -# map kitty_mod+g show_last_command_output -# map kitty_mod+enter new_window -# map cmd+enter new_window -# map kitty_mod+n new_os_window -# map cmd+n new_os_window -# map kitty_mod+w close_window -# map shift+cmd+d close_window -# map kitty_mod+] next_window -# map kitty_mod+[ previous_window -# map kitty_mod+f move_window_forward -# map kitty_mod+b move_window_backward -# map kitty_mod+` move_window_to_top -# map kitty_mod+r start_resizing_window -# map cmd+r start_resizing_window -# map kitty_mod+1 first_window -# map cmd+1 first_window -# map kitty_mod+2 second_window -# map cmd+2 second_window -# map kitty_mod+3 third_window -# map cmd+3 third_window -# map kitty_mod+4 fourth_window -# map cmd+4 fourth_window -# map kitty_mod+5 fifth_window -# map cmd+5 fifth_window -# map kitty_mod+6 sixth_window -# map cmd+6 sixth_window -# map kitty_mod+7 seventh_window -# map cmd+7 seventh_window -# map kitty_mod+8 eighth_window -# map cmd+8 eighth_window -# map kitty_mod+9 ninth_window -# map cmd+9 ninth_window -# map kitty_mod+0 tenth_window -# map kitty_mod+f7 focus_visible_window -# map kitty_mod+f8 swap_with_window -# map kitty_mod+right next_tab -# map shift+cmd+] next_tab -# map ctrl+tab next_tab -# map kitty_mod+left previous_tab -# map shift+cmd+[ previous_tab -# map ctrl+shift+tab previous_tab -# map kitty_mod+t new_tab -# map cmd+t new_tab -# map kitty_mod+q close_tab -# map cmd+w close_tab -# map shift+cmd+w close_os_window -# map kitty_mod+. move_tab_forward -# map kitty_mod+, move_tab_backward -# map kitty_mod+alt+t set_tab_title -# map shift+cmd+i set_tab_title -# map kitty_mod+l next_layout -# map kitty_mod+equal change_font_size all +2.0 -# map kitty_mod+plus change_font_size all +2.0 -# map kitty_mod+kp_add change_font_size all +2.0 -# map cmd+plus change_font_size all +2.0 -# map cmd+equal change_font_size all +2.0 -# map shift+cmd+equal change_font_size all +2.0 -# map kitty_mod+minus change_font_size all -2.0 -# map kitty_mod+kp_subtract change_font_size all -2.0 -# map cmd+minus change_font_size all -2.0 -# map shift+cmd+minus change_font_size all -2.0 -# map kitty_mod+backspace change_font_size all 0 -# map cmd+0 change_font_size all 0 -# map kitty_mod+e open_url_with_hints -# map kitty_mod+p>f kitten hints --type path --program - -# map kitty_mod+p>shift+f kitten hints --type path -# map kitty_mod+p>l kitten hints --type line --program - -# map kitty_mod+p>w kitten hints --type word --program - -# map kitty_mod+p>h kitten hints --type hash --program - -# map kitty_mod+p>n kitten hints --type linenum -# map kitty_mod+p>y kitten hints --type hyperlink -# map kitty_mod+f1 show_kitty_doc overview -# map kitty_mod+f11 toggle_fullscreen -# map ctrl+cmd+f toggle_fullscreen -# map kitty_mod+f10 toggle_maximized -# map opt+cmd+s toggle_macos_secure_keyboard_entry -# map kitty_mod+u kitten unicode_input -# map ctrl+cmd+space kitten unicode_input -# map kitty_mod+f2 edit_config_file -# map cmd+, edit_config_file -# map kitty_mod+escape kitty_shell window -# map kitty_mod+a>m set_background_opacity +0.1 -# map kitty_mod+a>l set_background_opacity -0.1 -# map kitty_mod+a>1 set_background_opacity 1 -# map kitty_mod+a>d set_background_opacity default map kitty_mod+k clear_terminal reset active -# map opt+cmd+r clear_terminal reset active -# map cmd+k clear_terminal to_cursor active -# map kitty_mod+f5 load_config_file -# map ctrl+cmd+, load_config_file -# map kitty_mod+f6 debug_config -# map opt+cmd+, debug_config -# map shift+cmd+/ open_url https://sw.kovidgoyal.net/kitty/ -# map cmd+h hide_macos_app -# map opt+cmd+h hide_macos_other_apps -# map cmd+m minimize_macos_window -# map cmd+q quit map kitty_mod+F5 launch --location=hsplit --cwd=current map kitty_mod+F6 launch --location=vsplit --cwd=current diff --git a/nvim/.editorconfig b/nvim/.editorconfig new file mode 100644 index 0000000..2e6feec --- /dev/null +++ b/nvim/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +indent_style = tab + diff --git a/nvim/init.lua b/nvim/init.lua index 87914ff..b0d2370 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,5 +1,5 @@ local fn = vim.fn -local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' +local install_path = fn.stdpath('config')..'/pack/packer/start/packer.nvim' if fn.empty(fn.glob(install_path)) > 0 then packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) end @@ -14,3 +14,5 @@ require 'keymaps' require 'autocommands' require 'plugins' require 'lsp' + +vim.cmd [[colorscheme moonfly]] diff --git a/nvim/lua/autocommands.lua b/nvim/lua/autocommands.lua index a052a8c..8db58e7 100644 --- a/nvim/lua/autocommands.lua +++ b/nvim/lua/autocommands.lua @@ -1,46 +1,46 @@ vim.api.nvim_create_autocmd({'BufWritePre'}, { - pattern = '*.go', - callback = function() - local params = vim.lsp.util.make_range_params(nil, vim.lsp.util._get_offset_encoding()) - params.context = { only = {'source.organizeImports'} } - local result = vim.lsp.buf_request_sync(0, 'textDocument/codeAction', params, 3000) - for _, res in pairs(result or {}) do - for _, r in pairs(res.result or {}) do - if r.edit then - vim.lsp.util.apply_workspace_edit(r.edit, vim.lsp.util._get_offset_encoding()) - else - vim.lsp.buf.execute_command(r.command) - end - end - end - end, + pattern = '*.go', + callback = function() + local params = vim.lsp.util.make_range_params(nil, vim.lsp.util._get_offset_encoding()) + params.context = { only = {'source.organizeImports'} } + local result = vim.lsp.buf_request_sync(0, 'textDocument/codeAction', params, 3000) + for _, res in pairs(result or {}) do + for _, r in pairs(res.result or {}) do + if r.edit then + vim.lsp.util.apply_workspace_edit(r.edit, vim.lsp.util._get_offset_encoding()) + else + vim.lsp.buf.execute_command(r.command) + end + end + end + end, }) vim.api.nvim_create_autocmd({'BufWritePre'}, { - pattern = '*.go', - callback = function() - vim.lsp.buf.format(nil, 3000) - end + pattern = '*.go', + callback = function() + vim.lsp.buf.format(nil, 3000) + end }) local TrimWhiteSpaceGrp = vim.api.nvim_create_augroup('TrimWhiteSpaceGrp', {}) vim.api.nvim_create_autocmd('BufWritePre', { group = TrimWhiteSpaceGrp, - pattern = '*', - command = '%s/\\s\\+$//e', + pattern = '*', + command = '%s/\\s\\+$//e', }) local YankHighlightGrp = vim.api.nvim_create_augroup('YankHighlightGrp', {}) vim.api.nvim_create_autocmd('TextYankPost', { group = YankHighlightGrp, - pattern = '*', - callback = function() - vim.highlight.on_yank({ - higroup = 'IncSearch', - timeout = 40, - }) - end, + pattern = '*', + callback = function() + vim.highlight.on_yank({ + higroup = 'IncSearch', + timeout = 40, + }) + end, }) diff --git a/nvim/lua/keymaps.lua b/nvim/lua/keymaps.lua index 6406100..75a11c4 100644 --- a/nvim/lua/keymaps.lua +++ b/nvim/lua/keymaps.lua @@ -15,9 +15,9 @@ map('v', 'i', '', opts) map('v', 'a', '', opts) -- Перемещение между буферами -kmap('n', 'bn', ':bnext', { noremap = true, silent = true }) -- Следующий буфер -kmap('n', 'bp', ':bprevious', { noremap = true, silent = true }) -- Предыдущий буфер -kmap('n', 'bd', ':bdelete', { noremap = true, silent = true }) -- Закрыть текущий буфер +kmap('n', 'bn', ':bnext', { noremap = true, silent = true }) -- Следующий буфер +kmap('n', 'bp', ':bprevious', { noremap = true, silent = true }) -- Предыдущий буфер +kmap('n', 'bd', ':bdelete', { noremap = true, silent = true }) -- Закрыть текущий буфер -- Tree map('n', '', ':NvimTreeToggle', opts) @@ -52,9 +52,9 @@ kmap('n', 'gr', vim.lsp.buf.references, opts) -- kmap('n', 'f', vim.lsp.buf.formatting, opts) local function change_root_to_global_cwd() - local api = require("nvim-tree.api") - local global_cwd = vim.fn.getcwd(-1, -1) - api.tree.change_root(global_cwd) + local api = require("nvim-tree.api") + local global_cwd = vim.fn.getcwd(-1, -1) + api.tree.change_root(global_cwd) end kmap('n', '', change_root_to_global_cwd, {}) diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index 5f160a9..6f575a9 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -2,44 +2,44 @@ vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 local options = { - backup = false, -- creates a backup file - clipboard = "unnamedplus", -- allows neovim to access the system clipboard - cmdheight = 2, -- more space in the neovim command line for displaying messages - completeopt = { "menuone", "noselect" }, -- mostly just for cmp - conceallevel = 0, -- so that `` is visible in markdown files - fileencoding = "utf-8", -- the encoding written to a file - hidden = true, -- required to keep multiple buffers and open multiple buffers - hlsearch = true, -- highlight all matches on previous search pattern - ignorecase = true, -- ignore case in search patterns - mouse = "a", -- allow the mouse to be used in neovim - pumheight = 10, -- pop up menu height - showmode = false, -- we don't need to see things like -- INSERT -- anymore - showtabline = 2, -- always show tabs - smartcase = true, -- smart case - smartindent = true, -- make indenting smarter again - splitbelow = true, -- force all horizontal splits to go below current window - splitright = true, -- force all vertical splits to go to the right of current window - swapfile = false, -- creates a swapfile - termguicolors = true, -- set term gui colors (most terminals support this) - undofile = true, -- enable persistent undo - updatetime = 300, -- faster completion (4000ms default) - 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 - shiftwidth = 2, -- the number of spaces inserted for each indentation - tabstop = 2, -- insert 2 spaces for a tab - cursorline = true, -- highlight the current line - number = true, -- set numbered lines - relativenumber = false, -- set relative numbered lines - numberwidth = 4, -- set number column width to 2 {default 4} - signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time - wrap = false, -- display lines as one long line - scrolloff = 8, -- is one of my fav - sidescrolloff = 8, + backup = false, + clipboard = "unnamedplus", + cmdheight = 2, + completeopt = { "menuone", "noselect" }, + conceallevel = 0, + fileencoding = "utf-8", + hidden = true, + hlsearch = true, + ignorecase = true, + mouse = "a", + pumheight = 10, + showmode = false, + showtabline = 2, + smartcase = true, + smartindent = true, + splitbelow = true, + splitright = true, + swapfile = false, + termguicolors = true, + undofile = true, + updatetime = 300, + writebackup = false, + shiftwidth = 4, + tabstop = 4, + cursorline = true, + number = true, + relativenumber = true, + numberwidth = 4, + signcolumn = "yes", + wrap = true, + scrolloff = 8, + sidescrolloff = 8, } vim.opt.shortmess:append "c" for k, v in pairs(options) do - vim.opt[k] = v + vim.opt[k] = v end vim.cmd "set whichwrap+=<,>,[,],h,l" diff --git a/nvim/lua/plugins/cmp.lua b/nvim/lua/plugins/cmp.lua index 01fc505..923cb09 100644 --- a/nvim/lua/plugins/cmp.lua +++ b/nvim/lua/plugins/cmp.lua @@ -1,39 +1,39 @@ local cmp = require'cmp' cmp.setup{ - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - -- require('snippy').expand_snippet(args.body) -- For `snippy` users. - -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. - -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + -- require('snippy').expand_snippet(args.body) -- For `snippy` users. + -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. + -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) - -- For `mini.snippets` users: - -- local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert - -- insert({ body = args.body }) -- Insert at cursor - -- cmp.resubscribe({ "TextChangedI", "TextChangedP" }) - -- require("cmp.config").set_onetime({ sources = {} }) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'vsnip' }, -- For vsnip users. - -- { name = 'luasnip' }, -- For luasnip users. - -- { name = 'ultisnips' }, -- For ultisnips users. - -- { name = 'snippy' }, -- For snippy users. - }, { - { name = 'buffer' }, - }) + -- For `mini.snippets` users: + -- local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert + -- insert({ body = args.body }) -- Insert at cursor + -- cmp.resubscribe({ "TextChangedI", "TextChangedP" }) + -- require("cmp.config").set_onetime({ sources = {} }) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, -- For vsnip users. + -- { name = 'luasnip' }, -- For luasnip users. + -- { name = 'ultisnips' }, -- For ultisnips users. + -- { name = 'snippy' }, -- For snippy users. + }, { + { name = 'buffer' }, + }) } diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index d21a585..f2f0676 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -1,7 +1,8 @@ -return require('packer').startup(function(use) +return require('packer').startup{function(use) use 'wbthomason/packer.nvim' use 'nvim-lua/plenary.nvim' use 'neovim/nvim-lspconfig' + use 'bluz71/vim-moonfly-colors' use { 'hrsh7th/nvim-cmp', requires = { @@ -15,12 +16,12 @@ return require('packer').startup(function(use) require 'plugins.cmp' end } - use { - 'nvim-lualine/lualine.nvim', - config = function() - require 'plugins.lualine' - end - } + use { + 'nvim-lualine/lualine.nvim', + config = function() + require 'plugins.lualine' + end + } use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate', @@ -36,12 +37,25 @@ return require('packer').startup(function(use) } use { 'nvim-tree/nvim-tree.lua', + requires = { + 'nvim-tree/nvim-web-devicons', + }, config = function() require 'plugins.tree' end } - use 'nvim-tree/nvim-web-devicons' + use { + "stevearc/conform.nvim", + config = function() + require("conform").setup() + end, + } if packer_bootstrap then require('packer').sync() end -end) +end, +config = { + -- The root has to be a directory named "pack" + package_root = vim.fn.stdpath('config') .. '/pack', +}} + diff --git a/nvim/lua/plugins/tree.lua b/nvim/lua/plugins/tree.lua index 86cc36c..cea966e 100644 --- a/nvim/lua/plugins/tree.lua +++ b/nvim/lua/plugins/tree.lua @@ -1,14 +1,14 @@ require("nvim-tree").setup({ - sort = { - sorter = "case_sensitive", - }, - view = { - width = 30, - }, - renderer = { - group_empty = true, - }, - filters = { - dotfiles = true, - }, + sort = { + sorter = "case_sensitive", + }, + view = { + width = 30, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = true, + }, }) diff --git a/nvim/pack/packer/start/cmp-buffer b/nvim/pack/packer/start/cmp-buffer new file mode 160000 index 0000000..b74fab3 --- /dev/null +++ b/nvim/pack/packer/start/cmp-buffer @@ -0,0 +1 @@ +Subproject commit b74fab3656eea9de20a9b8116afa3cfc4ec09657 diff --git a/nvim/pack/packer/start/cmp-nvim-lsp b/nvim/pack/packer/start/cmp-nvim-lsp new file mode 160000 index 0000000..a8912b8 --- /dev/null +++ b/nvim/pack/packer/start/cmp-nvim-lsp @@ -0,0 +1 @@ +Subproject commit a8912b88ce488f411177fc8aed358b04dc246d7b diff --git a/nvim/pack/packer/start/cmp-path b/nvim/pack/packer/start/cmp-path new file mode 160000 index 0000000..c6635aa --- /dev/null +++ b/nvim/pack/packer/start/cmp-path @@ -0,0 +1 @@ +Subproject commit c6635aae33a50d6010bf1aa756ac2398a2d54c32 diff --git a/nvim/pack/packer/start/cmp-vsnip b/nvim/pack/packer/start/cmp-vsnip new file mode 160000 index 0000000..989a8a7 --- /dev/null +++ b/nvim/pack/packer/start/cmp-vsnip @@ -0,0 +1 @@ +Subproject commit 989a8a73c44e926199bfd05fa7a516d51f2d2752 diff --git a/nvim/pack/packer/start/conform.nvim b/nvim/pack/packer/start/conform.nvim new file mode 160000 index 0000000..819c283 --- /dev/null +++ b/nvim/pack/packer/start/conform.nvim @@ -0,0 +1 @@ +Subproject commit 819c283db24211fd8ed2732b89a92ff9daa879b6 diff --git a/nvim/pack/packer/start/lualine.nvim b/nvim/pack/packer/start/lualine.nvim new file mode 160000 index 0000000..86fe395 --- /dev/null +++ b/nvim/pack/packer/start/lualine.nvim @@ -0,0 +1 @@ +Subproject commit 86fe39534b7da729a1ac56c0466e76f2c663dc42 diff --git a/nvim/pack/packer/start/nvim-cmp b/nvim/pack/packer/start/nvim-cmp new file mode 160000 index 0000000..b5311ab --- /dev/null +++ b/nvim/pack/packer/start/nvim-cmp @@ -0,0 +1 @@ +Subproject commit b5311ab3ed9c846b585c0c15b7559be131ec4be9 diff --git a/nvim/pack/nvim/start/nvim-lspconfig b/nvim/pack/packer/start/nvim-lspconfig similarity index 100% rename from nvim/pack/nvim/start/nvim-lspconfig rename to nvim/pack/packer/start/nvim-lspconfig diff --git a/nvim/pack/packer/start/nvim-tree.lua b/nvim/pack/packer/start/nvim-tree.lua new file mode 160000 index 0000000..3a63717 --- /dev/null +++ b/nvim/pack/packer/start/nvim-tree.lua @@ -0,0 +1 @@ +Subproject commit 3a63717d3d332d8f39aaf65be7a0e4c2265af021 diff --git a/nvim/pack/packer/start/nvim-treesitter b/nvim/pack/packer/start/nvim-treesitter new file mode 160000 index 0000000..684eeac --- /dev/null +++ b/nvim/pack/packer/start/nvim-treesitter @@ -0,0 +1 @@ +Subproject commit 684eeac91ed8e297685a97ef70031d19ac1de25a diff --git a/nvim/pack/packer/start/nvim-web-devicons b/nvim/pack/packer/start/nvim-web-devicons new file mode 160000 index 0000000..855c970 --- /dev/null +++ b/nvim/pack/packer/start/nvim-web-devicons @@ -0,0 +1 @@ +Subproject commit 855c97005c8eebcdd19846f2e54706bffd40ee96 diff --git a/nvim/pack/nvim/start/packer.nvim b/nvim/pack/packer/start/packer.nvim similarity index 100% rename from nvim/pack/nvim/start/packer.nvim rename to nvim/pack/packer/start/packer.nvim diff --git a/nvim/pack/packer/start/plenary.nvim b/nvim/pack/packer/start/plenary.nvim new file mode 160000 index 0000000..857c5ac --- /dev/null +++ b/nvim/pack/packer/start/plenary.nvim @@ -0,0 +1 @@ +Subproject commit 857c5ac632080dba10aae49dba902ce3abf91b35 diff --git a/nvim/pack/packer/start/telescope.nvim b/nvim/pack/packer/start/telescope.nvim new file mode 160000 index 0000000..a4ed825 --- /dev/null +++ b/nvim/pack/packer/start/telescope.nvim @@ -0,0 +1 @@ +Subproject commit a4ed82509cecc56df1c7138920a1aeaf246c0ac5 diff --git a/nvim/pack/packer/start/vim-moonfly-colors b/nvim/pack/packer/start/vim-moonfly-colors new file mode 160000 index 0000000..bfa6b24 --- /dev/null +++ b/nvim/pack/packer/start/vim-moonfly-colors @@ -0,0 +1 @@ +Subproject commit bfa6b2486a72784b7546d0d3e9322aef70e07b03 diff --git a/nvim/pack/packer/start/vim-vsnip b/nvim/pack/packer/start/vim-vsnip new file mode 160000 index 0000000..0a4b841 --- /dev/null +++ b/nvim/pack/packer/start/vim-vsnip @@ -0,0 +1 @@ +Subproject commit 0a4b8419e44f47c57eec4c90df17567ad4b1b36e