FG42/lisp/fg42/langs/cpp.el

64 lines
1.9 KiB
EmacsLisp

;;; FG42 --- The mighty editor for the emacsians -*- lexical-binding: t; -*-
;;
;; Copyright (c) 2010-2024 Sameer Rahmani & Contributors
;;
;; Author: Sameer Rahmani <lxsameer@gnu.org>
;; URL: https://devheroes.codes/FG42/FG42
;; Version: 3.0.0
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;
;;; Commentary:
;;; Code:
(require 'fpkg)
(require 'fg42/utils)
(require 'fg42/language-servers)
;; (use! cmake-ts-mode)
(use! eldoc-cmake
:hook (cmake-ts-mode . eldoc-cmake-enable))
(use! ninja-mode
"This cube enables Ninja integration with FG42. For more info checkout:
https://github.com/ninja-build/ninja/blob/master/misc/ninja-mode.el")
(use! c++-ts-mode
"C++ setup. We're using treesitter version of c++ mode."
:mode ("\\.h\\'" . c++-ts-mode)
:mode ("\\.hpp\\'" . c++-ts-mode)
:mode ("\\.cpp\\'" . c++-ts-mode)
:hook ((c++-ts-mode-hook . fg42/ls-run)
(c++-ts-mode-hook . fg42/cpp-autocomplete))
)
(add-hook 'c++-ts-mode-hook (setq-local company-backends
'((company-dabbrev company-ispell :separate)
company-files))
(lambda ()
(require 'company-capf)
(require 'company-box)
(setq company-backends
'((company-capf
company-keywords)))))
(provide 'fg42/langs/cpp)
;;; cpp.el ends here