aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/stdpaths.c
Commit message (Collapse)AuthorAge
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* build(IWYU): fix includes for func_attr.hdundargoc2023-11-27
|
* build: remove PVSdundargoc2023-11-12
| | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
* refactor: change some xstrndup() and xstrnsave() to xmemdupz() (#25959)zeertzjq2023-11-10
| | | | When the given length is exactly the number of bytes to copy, xmemdupz() makes the intention clearer.
* build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
|
* feat: NVIM_APPNAME supports relative paths #25233Rory Nesbitt2023-09-27
| | | | | | | | | | | | | | Problem: NVIM_APPNAME does not allow path separators in the name, so relative paths can't be used: NVIM_APPNAME="neovim-configs/first-config" nvim NVIM_APPNAME="neovim-configs/second-config" nvim Solution: Let NVIM_APPNAME be a relative path. Absolute paths are not supported. fix #23056 fix #24966
* fix(NVIM_APPNAME): show error message if $NVIM_APPNAME is invalidGhjuvan Lacambre2023-05-28
| | | Closes https://github.com/neovim/neovim/issues/23056.
* refactor: use xstrl{cpy,cat} on IObuff (#23648)ii142023-05-16
| | | | | Replace usage of STR{CPY,CAT} with xstrl{cpy,cat} when using on IObuff Co-authored-by: ii14 <ii14@users.noreply.github.com>
* feat: $NVIM_APPNAME #22128Ghjuvan Lacambre2023-02-16
| | | | | | | | | | | | | | | | | | | | This commit implements the ability to control all of the XDG paths Neovim should use. This is done by setting an environment variable named NVIM_APPNAME. For example, setting $NVIM_APPNAME makes Neovim look for its configuration directory in $XDG_CONFIG_HOME/$NVIM_APPNAME instead of $XDG_CONFIG_HOME/nvim. If NVIM_APPNAME is not set or is an empty string, "nvim" will be used as default. The usecase for this feature is to enable an easy way to switch from configuration to configuration. One might argue that the various $XDG environment variables can already be used for this usecase. However, setting $XDG environment variables also affects tools spawned by Neovim. For example, while setting $XDG_CONFIG_HOME will enable Neovim to use a different configuration directory, it will also prevent Git from finding its "default" configuration. Closes https://github.com/neovim/neovim/issues/21691
* refactor: replace char_u with char 24 (#21823)dundargoc2023-01-18
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
* fix(stdpath): default to /tmp if stdpath('run') cannot be created #20952zeertzjq2022-11-06
| | | Fix #20949
* vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)dundargoc2022-09-18
| | | | | | | Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and others. Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the GUI build. (Hirohito Higashi, closes vim/vim#3932) https://github.com/vim/vim/commit/4f97475d326c2773a78561fb874e4f23c25cbcd9
* fix(windows):exepath, stdpath return wrong slashes #19111Enan Ajmain2022-07-17
| | | | | | exepath and stdpath should respect shellslash and return path with proper file separator. Closes #13787
* feat: stdpath('run'), /tmp/nvim.user/ #18993Justin M. Keyes2022-06-30
| | | | | | | | | | | | | | | | Problem: - Since c57f6b28d71d #8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Store sockets in stdpath('run') ($XDG_RUNTIME_DIR). - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes #3517 closes #17093
* refactor: replace char_u variables and functions with charDundar Goc2022-05-16
| | | | Work on https://github.com/neovim/neovim/issues/459
* fix(windows): stdpath("state") => "nvim-data" #18546dundargoc2022-05-12
| | | This was missed in https://github.com/neovim/neovim/pull/15583
* feat(defaults): session data in $XDG_STATE_HOME #15583Ivan2022-05-12
| | | | | | | | | | | | See: https://gitlab.freedesktop.org/xdg/xdg-specs/-/commit/4f2884e16db35f2962d9b64312917c81be5cb54b - Move session persistent data to $XDG_STATE_HOME Change 'directory', 'backupdir', 'undodir', 'viewdir' and 'shadafile' default location to $XDG_STATE_HOME/nvim. - Move logs to $XDG_STATE_HOME, too. - Add stdpath('log') support. Fixes: #14805
* refactor: saner options for uncrustify (#16204)dundargoc2021-11-19
| | | | | | | | | | | | | | | | | | | | | | | | * sp_enum_after_assign = force * sp_brace_typedef = force * nl_do_brace = remove * sp_do_brace_open = force * sp_brace_close_while = force * sp_before_semi = remove * sp_before_semi_for = remove * sp_before_semi_for_empty = remove * sp_between_semi_for_empty = remove * sp_after_semi_for_empty = remove * sp_before_square = remove * sp_before_squares = remove * sp_inside_square = remove * sp_inside_fparens = remove * sp_inside_fparen = remove * sp_inside_tparen = remove * sp_after_tparen_close = remove * sp_return_paren = force * pos_bool = lead * sp_pp_concat = remove * sp_pp_stringify = remove * fixup: disable formatting for the INIT section
* refactor: format files with uncrustify #15663dundargoc2021-09-14
|
* logging: move to XDG_CACHE_HOME (#13739)Michael Lingelbach2021-01-13
| | | | | while there is some controversy, stdpath('cache') looks like a better fit for logs than stdpath('data'): you can remove logs without preventing nvim to work which fits the XDG_CACHE_HOME definition of `user specific non-essential data files`.
* stdpaths_get_xdg_var: consider empty env vars #10953Daniel Hahler2019-09-06
| | | | | Without this "sysinit uses VIM if XDG_CONFIG_DIRS unset" fails with an existing `/etc/xdg/nvim/sysinit.vim` file, because `XDG_CONFIG_DIRS=` is not considered, but the default ("/etc/xdg") used then.
* win/defaults: Use "…/nvim-data/site" in 'runtimepath'Justin M. Keyes2019-04-28
| | | | | | | | | | On Windows we store non-config data in "$XDG_DATA_HOME/nvim-data". But the "…/site" items in 'runtimepath' did not correctly point to that location, they used "…/nvim/site". Fix the init logic to use "…/nvim-data/site". closes #9910
* do not pass NULL to os_getenvJustin M. Keyes2018-05-18
| | | | closes #8393
* eval: Add stdpath() method (#5297)Christian Höltje2018-03-29
| | | | | | Adds the :stdpath method for fetching XDG standard directories. Fixes #5297
* *: Add comment to all C filesZyX2017-04-19
|
* XDG: Windows: resolve $LOCALAPPDATA, $TEMP (#5278)Rui Abreu Ferreira2017-01-08
| | | | | | | | | | After #4964 environment variables in the XDG "fallback" table are no longer expanded. Fallback to correctly expanded $LOCALAPPDATA, $TEMP. If that fails (unlikely), fallback to hard-coded paths (e.g. ~/AppData/Local). Closes #5255
* option: Also escape commas in options other then &runtimepathZyX2016-07-10
|
* Lint: fix line length >80Marco Hinz2016-03-04
| | | | | | Introduced here: https://github.com/neovim/neovim/commit/4bfac00aa389487c4f11d34e7a3e96e4a1116800#diff-2bf87eef9f7b99dcea4b0c55beee2d63R78
* Windows: XDG: Update default paths. #4403Rui Abreu Ferreira2016-03-03
| | | | | | | | | | | | | | | The previous defaults were including the nvim suffix, causing it to apear twice in the final paths. kXDGDataHome and kXDGConfigHome are now set as %LOCALAPPDATA%, kXDGCacheHome is set as $TEMP. In Windows there is no distinction between configuration and data storage, but we don't want to place all files under the same path. get_xdg_home() now appends a different path suffix for kXDGDataHome. - Configuration files are saved under %LOCALAPPDATA%\nvim - Data files are saved under %LOCALAPPDATA%\nvim-data
* stdpaths: Document that stdpaths_*_subpath is not returning NULLZyX2015-10-29
|
* stdpaths: Use NULL in place of empty stringsZyX2015-10-29
|
* stdpaths: Remove outdated commentZyX2015-10-23
|
* stdpaths: Add Windows-specific directoriesZyX2015-10-23
|
* stdpaths: Add missing includeZyX2015-10-23
|
* stdpaths: Remove Apple defaults, use \*nix ones insteadZyX2015-10-23
|
* option: Add `//` to the end of default `&directory`ZyX2015-10-23
|
* stdpaths: Add documentationZyX2015-10-23
|
* stdpaths: Do NOT create data directoriesZyX2015-10-23
| | | | | | This is none of option.c business to create *possibly unneeded* **default** directories **before** user specified where he actually wants to place the files.
* stdpaths: Give proper error message in case directory creation failedZyX2015-10-23
|
* stdpaths,main: Remove all remaining memory leaksZyX2015-10-23
|
* stdpaths: Export get_xdg function (renamed) and use it for runtimepathZyX2015-10-23
|
* stdpaths: Rename export functions so that they have common prefixZyX2015-10-23
|
* stdpaths: Remove useless functions get_user_*_dirZyX2015-10-23
|
* stdpaths: Fix some issues, specificallyZyX2015-10-23
| | | | | | | - Remove/add includes - Do not pretend that returns are const - Add function attributes - Allocate memory always in get_xdg
* option,main: Partial support of XDG base directory specificationKeerthan Jaic2015-10-23
- Add functions that are able to query XDG. - Replace defaults for - &runtimepath. Does not follow #78. - &viewdir. - &undodir. - &directory. - &backupdir. Does not follow #78. - vimrc location. - Remove user vimrc file line from :version message.